authorgravatar for 101306295+PauloCampana@users.noreply.github.comPauloCampana <101306295+PauloCampana@users.noreply.github.com> 2024-11-12 18:08:27-03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-11-12 22:08:27+01:00
loge6989fe6379e1161ce130780ec74c2b2179ddd1a
tree66dd4628d19099611aa7bfad4894f895b125fbf5
parent1db8cade5ab5c05fa3c6a884e50947633ebcf065
signaturebadge-check Signed by PGP key B5690EEEBB952194

std: fix compiler errors

See: #20505, #21094

3 files changed, 7 insertions(+), 9 deletions(-)

lib/std/c.zig+2-3
......@@ -8813,7 +8813,7 @@ pub const NOTE = switch (native_os) {
88138813 pub const EXIT_DETAIL = 0x02000000;
88148814 /// mask for signal & exit status
88158815 pub const PDATAMASK = 0x000fffff;
8816 pub const PCTRLMASK = (~PDATAMASK);
8816 pub const PCTRLMASK = 0xf0000000;
88178817 pub const EXIT_DETAIL_MASK = 0x00070000;
88188818 pub const EXIT_DECRYPTFAIL = 0x00010000;
88198819 pub const EXIT_MEMORY = 0x00020000;
......@@ -8947,7 +8947,7 @@ pub const NOTE = switch (native_os) {
89478947 pub const EXEC = 0x20000000;
89488948 /// mask for signal & exit status
89498949 pub const PDATAMASK = 0x000fffff;
8950 pub const PCTRLMASK = (~PDATAMASK);
8950 pub const PCTRLMASK = 0xf0000000;
89518951 /// data is seconds
89528952 pub const SECONDS = 0x00000001;
89538953 /// data is milliseconds
......@@ -9669,7 +9669,6 @@ pub const system_info = haiku.system_info;
96699669pub const team_id = haiku.team_id;
96709670pub const team_info = haiku.team_info;
96719671pub const thread_id = haiku.thread_id;
9672pub const vregs = haiku.vregs;
96739672
96749673pub const AUTH = openbsd.AUTH;
96759674pub const BI = openbsd.BI;
lib/std/os/windows.zig+3-3
......@@ -1110,7 +1110,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
11101110
11111111pub const MoveFileError = error{ FileNotFound, AccessDenied, Unexpected };
11121112
1113pub fn MoveFileEx(old_path: []const u8, new_path: []const u8, flags: DWORD) MoveFileError!void {
1113pub fn MoveFileEx(old_path: []const u8, new_path: []const u8, flags: DWORD) (MoveFileError || Wtf8ToPrefixedFileWError)!void {
11141114 const old_path_w = try sliceToPrefixedFileW(null, old_path);
11151115 const new_path_w = try sliceToPrefixedFileW(null, new_path);
11161116 return MoveFileExW(old_path_w.span().ptr, new_path_w.span().ptr, flags);
......@@ -1518,7 +1518,7 @@ pub const GetFileAttributesError = error{
15181518 Unexpected,
15191519};
15201520
1521pub fn GetFileAttributes(filename: []const u8) GetFileAttributesError!DWORD {
1521pub fn GetFileAttributes(filename: []const u8) (GetFileAttributesError || Wtf8ToPrefixedFileWError)!DWORD {
15221522 const filename_w = try sliceToPrefixedFileW(null, filename);
15231523 return GetFileAttributesW(filename_w.span().ptr);
15241524}
......@@ -1667,7 +1667,7 @@ pub fn getpeername(s: ws2_32.SOCKET, name: *ws2_32.sockaddr, namelen: *ws2_32.so
16671667
16681668pub fn sendmsg(
16691669 s: ws2_32.SOCKET,
1670 msg: *const ws2_32.WSAMSG,
1670 msg: *ws2_32.WSAMSG_const,
16711671 flags: u32,
16721672) i32 {
16731673 var bytes_send: DWORD = undefined;
lib/std/posix.zig+2-3
......@@ -154,7 +154,6 @@ pub const socklen_t = system.socklen_t;
154154pub const stack_t = system.stack_t;
155155pub const time_t = system.time_t;
156156pub const timespec = system.timespec;
157pub const timestamp_t = system.timestamp_t;
158157pub const timeval = system.timeval;
159158pub const timezone = system.timezone;
160159pub const ucontext_t = system.ucontext_t;
......@@ -5614,7 +5613,7 @@ pub const ClockGetTimeError = error{UnsupportedClock} || UnexpectedError;
56145613/// TODO: change this to return the timespec as a return value
56155614pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void {
56165615 if (native_os == .wasi and !builtin.link_libc) {
5617 var ts: timestamp_t = undefined;
5616 var ts: wasi.timestamp_t = undefined;
56185617 switch (system.clock_time_get(clock_id, 1, &ts)) {
56195618 .SUCCESS => {
56205619 tp.* = .{
......@@ -5655,7 +5654,7 @@ pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void
56555654
56565655pub fn clock_getres(clock_id: clockid_t, res: *timespec) ClockGetTimeError!void {
56575656 if (native_os == .wasi and !builtin.link_libc) {
5658 var ts: timestamp_t = undefined;
5657 var ts: wasi.timestamp_t = undefined;
56595658 switch (system.clock_res_get(@bitCast(clock_id), &ts)) {
56605659 .SUCCESS => res.* = .{
56615660 .sec = @intCast(ts / std.time.ns_per_s),