mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
compiler: Define __FreeBSD_version when targeting FreeBSD libc.
This commit is contained in:
parent
be566a4c11
commit
9e23e1d16c
1 changed files with 9 additions and 0 deletions
|
|
@ -5852,6 +5852,15 @@ pub fn addCCArgs(
|
|||
try argv.append(
|
||||
try std.fmt.allocPrint(arena, "-D_WIN32_WINNT=0x{x:0>4}", .{minver}),
|
||||
);
|
||||
} else if (target.isFreeBSDLibC()) {
|
||||
// https://docs.freebsd.org/en/books/porters-handbook/versions
|
||||
const min_ver = target.os.version_range.semver.min;
|
||||
try argv.append(try std.fmt.allocPrint(arena, "-D__FreeBSD_version={d}", .{
|
||||
// We don't currently respect the minor and patch components. This wouldn't be particularly
|
||||
// helpful because our abilists file only tracks major FreeBSD releases, so the link-time stub
|
||||
// symbols would be inconsistent with header declarations.
|
||||
min_ver.major * 100_000,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue