From 2d8c6bc1994edebfdcec3cddac242c643a614931 Mon Sep 17 00:00:00 2001 From: PauloCampana Date: Wed, 2 Oct 2024 22:38:31 -0300 Subject: [PATCH] #20505 fix std.c --- lib/std/c.zig | 5 ++--- lib/std/c/darwin.zig | 2 +- lib/std/posix.zig | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/std/c.zig b/lib/std/c.zig index c1523cd68a54..f476e0e8b5f7 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -8723,7 +8723,7 @@ pub const NOTE = switch (native_os) { pub const EXIT_DETAIL = 0x02000000; /// mask for signal & exit status pub const PDATAMASK = 0x000fffff; - pub const PCTRLMASK = (~PDATAMASK); + pub const PCTRLMASK = ~@as(u32, PDATAMASK); pub const EXIT_DETAIL_MASK = 0x00070000; pub const EXIT_DECRYPTFAIL = 0x00010000; pub const EXIT_MEMORY = 0x00020000; @@ -8857,7 +8857,7 @@ pub const NOTE = switch (native_os) { pub const EXEC = 0x20000000; /// mask for signal & exit status pub const PDATAMASK = 0x000fffff; - pub const PCTRLMASK = (~PDATAMASK); + pub const PCTRLMASK = ~@as(u32, PDATAMASK); /// data is seconds pub const SECONDS = 0x00000001; /// data is milliseconds @@ -9579,7 +9579,6 @@ pub const system_info = haiku.system_info; pub const team_id = haiku.team_id; pub const team_info = haiku.team_info; pub const thread_id = haiku.thread_id; -pub const vregs = haiku.vregs; pub const AUTH = openbsd.AUTH; pub const BI = openbsd.BI; diff --git a/lib/std/c/darwin.zig b/lib/std/c/darwin.zig index 3537ad3078cd..573f29150d94 100644 --- a/lib/std/c/darwin.zig +++ b/lib/std/c/darwin.zig @@ -10,7 +10,7 @@ const mode_t = std.c.mode_t; const off_t = std.c.off_t; const pid_t = std.c.pid_t; const pthread_attr_t = std.c.pthread_attr_t; -const sigset_t = std.c.segset_t; +const sigset_t = std.c.sigset_t; const timespec = std.c.timespec; const sf_hdtr = std.c.sf_hdtr; diff --git a/lib/std/posix.zig b/lib/std/posix.zig index 8eb6ed256be5..994edda42b64 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -154,7 +154,6 @@ pub const socklen_t = system.socklen_t; pub const stack_t = system.stack_t; pub const time_t = system.time_t; pub const timespec = system.timespec; -pub const timestamp_t = system.timestamp_t; pub const timeval = system.timeval; pub const timezone = system.timezone; pub const ucontext_t = system.ucontext_t; @@ -5595,7 +5594,7 @@ pub const ClockGetTimeError = error{UnsupportedClock} || UnexpectedError; /// TODO: change this to return the timespec as a return value pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void { if (native_os == .wasi and !builtin.link_libc) { - var ts: timestamp_t = undefined; + var ts: wasi.timestamp_t = undefined; switch (system.clock_time_get(clock_id, 1, &ts)) { .SUCCESS => { tp.* = .{ @@ -5636,7 +5635,7 @@ pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void pub fn clock_getres(clock_id: clockid_t, res: *timespec) ClockGetTimeError!void { if (native_os == .wasi and !builtin.link_libc) { - var ts: timestamp_t = undefined; + var ts: wasi.timestamp_t = undefined; switch (system.clock_res_get(@bitCast(clock_id), &ts)) { .SUCCESS => res.* = .{ .sec = @intCast(ts / std.time.ns_per_s),