authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-05-13 01:40:43+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-05-17 04:41:27+02:00
loge20fb7071cc9d9eab6efd0f4b57f49be20ad866f
treefd593c373e7aae15b8046a9a2ad36ae877444bd0
parentc36d483ba0d7101ec8c8664fe3de88237a310272
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

compiler: Define __NetBSD_Version__ when targeting NetBSD libc.


1 files changed, 8 insertions(+), 0 deletions(-)

src/Compilation.zig+8
...@@ -5921,6 +5921,14 @@ pub fn addCCArgs(...@@ -5921,6 +5921,14 @@ pub fn addCCArgs(
5921 // symbols would be inconsistent with header declarations.5921 // symbols would be inconsistent with header declarations.
5922 min_ver.major * 100_000,5922 min_ver.major * 100_000,
5923 }));5923 }));
5924 } else if (target.isNetBSDLibC()) {
5925 const min_ver = target.os.version_range.semver.min;
5926 try argv.append(try std.fmt.allocPrint(arena, "-D__NetBSD_Version__={d}", .{
5927 // We don't currently respect the patch component. This wouldn't be particularly helpful because
5928 // our abilists file only tracks major and minor NetBSD releases, so the link-time stub symbols
5929 // would be inconsistent with header declarations.
5930 (min_ver.major * 100_000_000) + (min_ver.minor * 1_000_000),
5931 }));
5924 }5932 }
5925 }5933 }
59265934