Skip to content

Commit

Permalink
add -DWIDL_EXPLICIT_AGGREGATE_RETURNS when targeting mingw-w64
Browse files Browse the repository at this point in the history
See discussion on #9998
  • Loading branch information
andrewrk committed Dec 18, 2021
1 parent 5b29b4f commit c5f56d9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c5f56d9

Please sign in to comment.