From 7bc1695f15e83bb7e0e1401d2411660b05ab65e3 Mon Sep 17 00:00:00 2001 From: kcbanner Date: Sat, 1 Jul 2023 10:43:34 -0400 Subject: [PATCH] c: musl doesn't implement getcontext, so defer to our implementation in that case --- lib/std/c.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/std/c.zig b/lib/std/c.zig index 94b7f57657..6f193fb9ee 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -413,7 +413,12 @@ pub extern "c" fn timer_delete(timerid: c.timer_t) c_int; pub extern "c" fn timer_settime(timerid: c.timer_t, flags: c_int, new_value: *const c.itimerspec, old_value: *c.itimerspec) c_int; pub extern "c" fn timer_gettime(timerid: c.timer_t, flags: c_int, curr_value: *c.itimerspec) c_int; -pub extern "c" fn getcontext(ucp: *std.os.ucontext_t) c_int; +pub usingnamespace if (builtin.os.tag == .linux and builtin.target.isMusl()) struct { + // musl does not implement getcontext + const getcontext = std.os.linux.getcontext; +} else struct { + extern "c" fn getcontext(ucp: *std.os.ucontext_t) c_int; +}; pub const max_align_t = if (builtin.abi == .msvc) f64