Skip to content

Commit 6b4a382

Browse files
committed
Add support for MinGW-w64 v7.0.0
I've diffed the relevant subtress (mingw-w64-crt/lib{32,64,-common}) of v6 and v7 manually and hopefully caught most potential regressions (MS functions newly overridden by MinGW implementations).
1 parent bafb3c9 commit 6b4a382

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

buildsdk.d

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ void sanitizeDef(string defFile)
9191
// ucrtbase.def:
9292
"_assert", "_cabs", "_fpreset", "_tzset",
9393
"ceil", "ceilf", "coshf", "fabs",
94+
"feclearexcept", "fegetenv", "fegetexceptflag", "fegetround", "feholdexcept",
95+
"fesetenv", "fesetexceptflag", "fesetround", "fetestexcept",
9496
"floor", "floorf", "modf", "modff",
97+
"lgamma", "lgammaf", "lgammal",
9598
"sinhf", "sqrt", "sqrtf", "wcsnlen",
9699
// additional ones in msvcr100.def:
97100
"__report_gsfailure",
@@ -104,7 +107,7 @@ void sanitizeDef(string defFile)
104107
"_wassert",
105108
"acosf", "asinf", "atan2", "atan2f", "atanf",
106109
"btowc",
107-
"cos", "cosf", "exp", "expf", "fmod", "fmodf", "ldexp",
110+
"cos", "cosf", "exp", "expf", "fmod", "fmodf", "frexp", "ldexp",
108111
"longjmp",
109112
"llabs", "lldiv",
110113
"log", "log10f", "logf",
@@ -143,10 +146,13 @@ void sanitizeDef(string defFile)
143146
}
144147

145148
// Un-hide functions overridden by the MinGW runtime.
146-
foreach (name; overriddenMinGWFunctions)
149+
if (line.endsWith(" DATA"))
147150
{
148-
if (line.length == name.length + 5 && line.startsWith(name) && line.endsWith(" DATA"))
149-
return name;
151+
foreach (name; overriddenMinGWFunctions)
152+
{
153+
if (line.length == name.length + 5 && line.startsWith(name))
154+
return name;
155+
}
150156
}
151157

152158
// Don't export function 'atexit'; we have our own in msvc_atexit.c.
@@ -248,7 +254,7 @@ bool defWithStdcallMangling2implib(string defFile)
248254
line.startsWith("LIBRARY ") || line.startsWith("EXPORTS"))
249255
return line;
250256

251-
if (line.endsWith(" DATA"))
257+
if (line.length > 5 && (line[$-5] == ' ' || line[$-5] == '\t') && line.endsWith("DATA"))
252258
{
253259
fields ~= line[0 .. $-5];
254260
return line;

0 commit comments

Comments
 (0)