Skip to content

Commit 33aa1e8

Browse files
committed
Add support for MinGW-w64 v8.0.0
[And sync with upstream.] I've compared the crucial {msvcr*,ucrtbase}.def.in files against v7.0.0, and they don't seem to feature any relevant changes. See http://mingw-w64.org/doku.php/versions for the changelog; Direct3D 12 is one of the additions. Corresponding upstream PR is dlang/installer#474.
1 parent 538ff28 commit 33aa1e8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

buildsdk.d

+7-2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ void sanitizeDef(string defFile)
164164
if (line == "ExtractIconW@")
165165
return ";ExtractIconW@";
166166

167+
// Apparent bugs in lib32/api-ms-win-*.def - missing stdcall params size suffix.
168+
if (line[$-1] == '@' && baseName(defFile).startsWith("api-ms-win-"))
169+
return ";" ~ line;
170+
167171
return line;
168172
});
169173
}
@@ -207,7 +211,8 @@ void def2implib(string defFile)
207211
}
208212

209213
const libFile = setExtension(defFile, ".lib");
210-
runShell(`lib "/DEF:` ~ defFile ~ `" "/OUT:` ~ libFile ~ `"`);
214+
const machine = x64 ? "X64" : "X86";
215+
runShell(`lib "/DEF:` ~ defFile ~ `" /MACHINE:` ~ machine ~ ` "/OUT:` ~ libFile ~ `"`);
211216
std.file.remove(setExtension(defFile, ".exp"));
212217
}
213218

@@ -378,7 +383,7 @@ void buildMsvcrt(string outDir)
378383
// compile some additional objects
379384
foreach (i; 0 .. 3)
380385
addObj(format!"msvcrt_stub%d.obj"(i), format!"/D_APPTYPE=%d msvcrt_stub.c"(i));
381-
foreach (i; 0 .. 3)
386+
foreach (i; 1 .. 3) // not needed for DLLs
382387
addObj(format!"msvcrt_stub_wide%d.obj"(i), format!"/D_APPTYPE=%d /D_UNICODE msvcrt_stub.c"(i));
383388
addObj("msvcrt_data.obj", "msvcrt_data.c");
384389
addObj("msvcrt_atexit.obj", "msvcrt_atexit.c");

legacy_stdio_definitions.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ void __legacy_stdio_definitions()
3636
vwscanf(NULL, NULL);
3737
wprintf(NULL);
3838
wscanf(NULL);
39-
}
39+
}

0 commit comments

Comments
 (0)