From c5f56d958a9d21cd8976e382266378180debd2bb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 18 Dec 2021 15:43:47 -0700 Subject: [PATCH] add -DWIDL_EXPLICIT_AGGREGATE_RETURNS when targeting mingw-w64 See discussion on #9998 --- src/Compilation.zig | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Compilation.zig b/src/Compilation.zig index b3c2608c0573..8e1ba3ef5352 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3415,12 +3415,17 @@ pub fn addCCArgs( try argv.append(libunwind_include_path); } - if (comp.bin_file.options.link_libc and target.isGnuLibC()) { - const target_version = target.os.version_range.linux.glibc; - const glibc_minor_define = try std.fmt.allocPrint(arena, "-D__GLIBC_MINOR__={d}", .{ - target_version.minor, - }); - try argv.append(glibc_minor_define); + if (comp.bin_file.options.link_libc) { + if (target.isGnuLibC()) { + const target_version = target.os.version_range.linux.glibc; + const glibc_minor_define = try std.fmt.allocPrint(arena, "-D__GLIBC_MINOR__={d}", .{ + target_version.minor, + }); + try argv.append(glibc_minor_define); + } + if (target.isMinGW()) { + try argv.append("-DWIDL_EXPLICIT_AGGREGATE_RETURNS"); + } } const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target);