Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit c305472

Browse files
WalterBrightdlang-bot
authored andcommitted
compile mscoff .c files with ImportC
1 parent 148608b commit c305472

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/importc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
*/
3434
#define __fastcall
3535

36+
/* Microsoft builtin types */
37+
#define __int8 char
38+
#define __int16 short
39+
#define __int32 int
40+
#define __int64 long long
41+
3642
/*********************
3743
* Obsolete detritus
3844
*/

win64.mak

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,9 @@ DDOCFLAGS=-conf= -c -w -o- -Isrc -Iimport -version=CoreDdoc
2424

2525
UTFLAGS=-version=CoreUnittest -unittest -checkaction=context
2626

27-
CFLAGS=/Z7
28-
2927
DRUNTIME_BASE=druntime$(MODEL)
3028
DRUNTIME=lib\$(DRUNTIME_BASE).lib
3129

32-
# do not preselect a C runtime (extracted from the line above to make the auto tester happy)
33-
CFLAGS=$(CFLAGS) /Zl
34-
3530
DOCFMT=
3631

3732
target: copydir copy $(DRUNTIME)
@@ -59,7 +54,7 @@ copy:
5954
################### C\ASM Targets ############################
6055

6156
errno_c_$(MODEL).obj: src\core\stdc\errno.c
62-
"$(CC)" -c -Fo$@ $(CFLAGS) src\core\stdc\errno.c
57+
$(DMD) -c -of=$@ $(DFLAGS) -v -P=-I. src\core\stdc\errno.c
6358

6459
################### Library generation #########################
6560

@@ -80,32 +75,32 @@ test_aa:
8075
"$(DMD)" -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIME) -run test\aa\src\test_aa.d
8176

8277
test_betterc:
83-
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
78+
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) test
8479

8580
test_betterc_mingw:
86-
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" MINGW=_mingw test
81+
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) MINGW=_mingw test
8782

8883
test_cpuid:
89-
"$(MAKE)" -f test\cpuid\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
84+
"$(MAKE)" -f test\cpuid\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) test
9085

9186
test_exceptions:
92-
"$(MAKE)" -f test\exceptions\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
87+
"$(MAKE)" -f test\exceptions\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) test
9388

9489
test_hash:
9590
"$(DMD)" -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIME) -run test\hash\src\test_hash.d
9691

9792
test_stdcpp:
9893
setmscver.bat
99-
"$(MAKE)" -f test\stdcpp\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
94+
"$(MAKE)" -f test\stdcpp\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) test
10095

10196
test_gc:
102-
"$(MAKE)" -f test\gc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
97+
"$(MAKE)" -f test\gc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) test
10398

10499
custom_gc:
105-
$(MAKE) -f test\init_fini\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
100+
$(MAKE) -f test\init_fini\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) test
106101

107102
test_shared:
108-
$(MAKE) -f test\shared\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
103+
$(MAKE) -f test\shared\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) test
109104

110105
test_common: test_shared test_aa test_cpuid test_exceptions test_hash test_gc custom_gc
111106

0 commit comments

Comments
 (0)