Skip to content

Commit 5810d71

Browse files
committed
mingw: add comments so that I don't regress this code later
Martin Storsjö kindly took the time to discuss things at length with me, and the results are that this status quo is correct. I added comments so that I don't think it should be changed later.
1 parent 52f36d6 commit 5810d71

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/mingw.zig

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: *std.Progr
8787

8888
"-std=gnu99",
8989
"-D_CRTBLD",
90+
// According to Martin Storsjö,
91+
// > the files under mingw-w64-crt are designed to always
92+
// be built with __MSVCRT_VERSION__=0x700
9093
"-D__MSVCRT_VERSION__=0x700",
9194
"-D__USE_MINGW_ANSI_STDIO=0",
9295
});
@@ -113,9 +116,11 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: *std.Progr
113116

114117
"-std=gnu99",
115118
"-D_CRTBLD",
119+
// According to Martin Storsjö,
120+
// > the files under mingw-w64-crt are designed to always
121+
// be built with __MSVCRT_VERSION__=0x700
116122
"-D__MSVCRT_VERSION__=0x700",
117123
"-D__USE_MINGW_ANSI_STDIO=0",
118-
119124
"-isystem",
120125
try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libc", "include", "any-windows-any" }),
121126
});
@@ -179,9 +184,11 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: *std.Progr
179184

180185
"-std=gnu99",
181186
"-D_CRTBLD",
187+
// According to Martin Storsjö,
188+
// > the files under mingw-w64-crt are designed to always
189+
// be built with __MSVCRT_VERSION__=0x700
182190
"-D__MSVCRT_VERSION__=0x700",
183191
"-D__USE_MINGW_ANSI_STDIO=0",
184-
185192
"-isystem",
186193
try comp.zig_lib_directory.join(arena, &[_][]const u8{
187194
"libc", "include", "any-windows-any",
@@ -225,6 +232,9 @@ fn add_cc_args(
225232
try args.appendSlice(&[_][]const u8{
226233
"-std=gnu11",
227234
"-D_CRTBLD",
235+
// According to Martin Storsjö,
236+
// > the files under mingw-w64-crt are designed to always
237+
// be built with __MSVCRT_VERSION__=0x700
228238
"-D__MSVCRT_VERSION__=0x700",
229239
"-D__USE_MINGW_ANSI_STDIO=0",
230240
});

0 commit comments

Comments
 (0)