| ... | @@ -5086,12 +5086,17 @@ pub fn addCCArgs( | ... | @@ -5086,12 +5086,17 @@ pub fn addCCArgs( |
| 5086 | try argv.append(libunwind_include_path); | 5086 | try argv.append(libunwind_include_path); |
| 5087 | } | 5087 | } |
| 5088 | | 5088 | |
| 5089 | if (comp.config.link_libc and target.isGnuLibC()) { | 5089 | if (comp.config.link_libc) { |
| 5090 | const target_version = target.os.version_range.linux.glibc; | 5090 | if (target.isGnuLibC()) { |
| 5091 | const glibc_minor_define = try std.fmt.allocPrint(arena, "-D__GLIBC_MINOR__={d}", .{ | 5091 | const target_version = target.os.version_range.linux.glibc; |
| 5092 | target_version.minor, | 5092 | const glibc_minor_define = try std.fmt.allocPrint(arena, "-D__GLIBC_MINOR__={d}", .{ |
| 5093 | }); | 5093 | target_version.minor, |
| 5094 | try argv.append(glibc_minor_define); | 5094 | }); |
| | 5095 | try argv.append(glibc_minor_define); |
| | 5096 | } else if (target.isMinGW()) { |
| | 5097 | try argv.append("-D__MSVCRT_VERSION__=0xE00"); // use ucrt |
| | 5098 | |
| | 5099 | } |
| 5095 | } | 5100 | } |
| 5096 | | 5101 | |
| 5097 | const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target); | 5102 | const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target); |
| ... | @@ -5100,10 +5105,9 @@ pub fn addCCArgs( | ... | @@ -5100,10 +5105,9 @@ pub fn addCCArgs( |
| 5100 | if (target.os.tag == .windows) switch (ext) { | 5105 | if (target.os.tag == .windows) switch (ext) { |
| 5101 | .c, .cpp, .m, .mm, .h, .cu, .rc, .assembly, .assembly_with_cpp => { | 5106 | .c, .cpp, .m, .mm, .h, .cu, .rc, .assembly, .assembly_with_cpp => { |
| 5102 | const minver: u16 = @truncate(@intFromEnum(target.os.getVersionRange().windows.min) >> 16); | 5107 | const minver: u16 = @truncate(@intFromEnum(target.os.getVersionRange().windows.min) >> 16); |
| 5103 | try argv.appendSlice(&.{ | 5108 | try argv.append( |
| 5104 | try std.fmt.allocPrint(arena, "-D_WIN32_WINNT=0x{x:0>4}", .{minver}), | 5109 | try std.fmt.allocPrint(arena, "-D_WIN32_WINNT=0x{x:0>4}", .{minver}), |
| 5105 | "-D__MSVCRT_VERSION__=0xE00", // use ucrt | 5110 | ); |
| 5106 | }); | | |
| 5107 | }, | 5111 | }, |
| 5108 | else => {}, | 5112 | else => {}, |
| 5109 | }; | 5113 | }; |