authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-07 16:18:18-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-08 11:52:38-07:00
loge2a8fe721dbf31a8edd06c8273bee8a8e69381f2
treeafac039e3eb989f8e2faea3bf75cc18d09992e1a
parent3f4c73ae938f228e13ccc4f2442d7a6cd38111be

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 files changed, 12 insertions(+), 2 deletions(-)

src/mingw.zig+12-2
......@@ -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 });