authorgravatar for john.schmidt.h@gmail.comJohn Schmidt <john.schmidt.h@gmail.com> 2022-01-19 15:11:29+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-01-26 00:48:05-05:00
log9ee67b967bd8ed2f11c24078ac16f9fd96b44a39
tree8ae86c16c60b0b527ee35c332a4951ce7f16407e
parent0c1df96b17fcafdb0aa973dfcb1819929719d650

stage2: avoid inferred struct in os_version_check.zig

Before this commit, compiling an empty main with Stage 2 on macOS x86_64 results in ``` ../stage2/bin/zig build-exe -ODebug -fLLVM empty_main.zig error: sub-compilation of compiler_rt failed [...]/zig/stage2/lib/zig/std/special/compiler_rt/os_version_check.zig:26:10: error: TODO: Sema.zirStructInit for runtime-known struct values ``` By assigning the value to a variable we can sidestep the issue for now.

1 files changed, 5 insertions(+), 6 deletions(-)

lib/std/special/compiler_rt/os_version_check.zig+5-6
...@@ -22,12 +22,11 @@ inline fn constructVersion(major: u32, minor: u32, subminor: u32) u32 {...@@ -22,12 +22,11 @@ inline fn constructVersion(major: u32, minor: u32, subminor: u32) u32 {
2222
23// Darwin-only23// Darwin-only
24pub fn __isPlatformVersionAtLeast(platform: u32, major: u32, minor: u32, subminor: u32) callconv(.C) i32 {24pub fn __isPlatformVersionAtLeast(platform: u32, major: u32, minor: u32, subminor: u32) callconv(.C) i32 {
25 return @boolToInt(_availability_version_check(1, &[_]dyld_build_version_t{25 const build_version = dyld_build_version_t{
26 .{26 .platform = platform,
27 .platform = platform,27 .version = constructVersion(major, minor, subminor),
28 .version = constructVersion(major, minor, subminor),28 };
29 },29 return @boolToInt(_availability_version_check(1, &[_]dyld_build_version_t{build_version}));
30 }));
31}30}
3231
33// _availability_version_check darwin API support.32// _availability_version_check darwin API support.