Skip to content

Commit

Permalink
ziglang#20505 fix std.c
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloCampana committed Oct 3, 2024
1 parent f424bec commit 2d8c6bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions lib/std/c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/std/c/darwin.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 2 additions & 3 deletions lib/std/posix.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.* = .{
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 2d8c6bc

Please sign in to comment.