authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-03-07 16:11:57+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-03-08 08:02:44+00:00
log474d17c13ae9f9f51cb2e7f18d3d61353f1ccd83
tree396742ec6cf0acb8e6b254722d23253bf332fa00
parent17f83ace03a3bcb4f42958b43527792c186cd498
signaturelock-open Commit is signed but in an unrecognized format.

std.c: do not use `usingnamespace` to define getcontext

Eliminates one more usage of `usingnamespace` from the standard library.

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

lib/std/c.zig+8-10
......@@ -1863,16 +1863,14 @@ pub extern "c" fn setlogmask(maskpri: c_int) c_int;
18631863
18641864pub extern "c" fn if_nametoindex([*:0]const u8) c_int;
18651865
1866pub usingnamespace if (builtin.target.isAndroid()) struct {
1867 // android bionic libc does not implement getcontext,
1868 // and std.os.linux.getcontext also cannot be built for
1869 // bionic libc currently.
1870} else if (native_os == .linux and builtin.target.isMusl()) struct {
1871 // musl does not implement getcontext
1872 pub const getcontext = std.os.linux.getcontext;
1873} else struct {
1874 pub extern "c" fn getcontext(ucp: *std.os.ucontext_t) c_int;
1875};
1866pub const getcontext = if (builtin.target.isAndroid())
1867 @compileError("android bionic libc does not implement getcontext")
1868else if (native_os == .linux and builtin.target.isMusl())
1869 std.os.linux.getcontext
1870else
1871 struct {
1872 extern fn getcontext(ucp: *std.os.ucontext_t) c_int;
1873 }.getcontext;
18761874
18771875pub const max_align_t = if (native_abi == .msvc)
18781876 f64