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) {...@@ -8813,7 +8813,7 @@ pub const NOTE = switch (native_os) {
8813 pub const EXIT_DETAIL = 0x02000000;8813 pub const EXIT_DETAIL = 0x02000000;
8814 /// mask for signal & exit status8814 /// mask for signal & exit status
8815 pub const PDATAMASK = 0x000fffff;8815 pub const PDATAMASK = 0x000fffff;
8816 pub const PCTRLMASK = (~PDATAMASK);8816 pub const PCTRLMASK = 0xf0000000;
8817 pub const EXIT_DETAIL_MASK = 0x00070000;8817 pub const EXIT_DETAIL_MASK = 0x00070000;
8818 pub const EXIT_DECRYPTFAIL = 0x00010000;8818 pub const EXIT_DECRYPTFAIL = 0x00010000;
8819 pub const EXIT_MEMORY = 0x00020000;8819 pub const EXIT_MEMORY = 0x00020000;
...@@ -8947,7 +8947,7 @@ pub const NOTE = switch (native_os) {...@@ -8947,7 +8947,7 @@ pub const NOTE = switch (native_os) {
8947 pub const EXEC = 0x20000000;8947 pub const EXEC = 0x20000000;
8948 /// mask for signal & exit status8948 /// mask for signal & exit status
8949 pub const PDATAMASK = 0x000fffff;8949 pub const PDATAMASK = 0x000fffff;
8950 pub const PCTRLMASK = (~PDATAMASK);8950 pub const PCTRLMASK = 0xf0000000;
8951 /// data is seconds8951 /// data is seconds
8952 pub const SECONDS = 0x00000001;8952 pub const SECONDS = 0x00000001;
8953 /// data is milliseconds8953 /// data is milliseconds
...@@ -9669,7 +9669,6 @@ pub const system_info = haiku.system_info;...@@ -9669,7 +9669,6 @@ pub const system_info = haiku.system_info;
9669pub const team_id = haiku.team_id;9669pub const team_id = haiku.team_id;
9670pub const team_info = haiku.team_info;9670pub const team_info = haiku.team_info;
9671pub const thread_id = haiku.thread_id;9671pub const thread_id = haiku.thread_id;
9672pub const vregs = haiku.vregs;
96739672
9674pub const AUTH = openbsd.AUTH;9673pub const AUTH = openbsd.AUTH;
9675pub const BI = openbsd.BI;9674pub 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...@@ -1110,7 +1110,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
11101110
1111pub const MoveFileError = error{ FileNotFound, AccessDenied, Unexpected };1111pub 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 {
1114 const old_path_w = try sliceToPrefixedFileW(null, old_path);1114 const old_path_w = try sliceToPrefixedFileW(null, old_path);
1115 const new_path_w = try sliceToPrefixedFileW(null, new_path);1115 const new_path_w = try sliceToPrefixedFileW(null, new_path);
1116 return MoveFileExW(old_path_w.span().ptr, new_path_w.span().ptr, flags);1116 return MoveFileExW(old_path_w.span().ptr, new_path_w.span().ptr, flags);
...@@ -1518,7 +1518,7 @@ pub const GetFileAttributesError = error{...@@ -1518,7 +1518,7 @@ pub const GetFileAttributesError = error{
1518 Unexpected,1518 Unexpected,
1519};1519};
15201520
1521pub fn GetFileAttributes(filename: []const u8) GetFileAttributesError!DWORD {1521pub fn GetFileAttributes(filename: []const u8) (GetFileAttributesError || Wtf8ToPrefixedFileWError)!DWORD {
1522 const filename_w = try sliceToPrefixedFileW(null, filename);1522 const filename_w = try sliceToPrefixedFileW(null, filename);
1523 return GetFileAttributesW(filename_w.span().ptr);1523 return GetFileAttributesW(filename_w.span().ptr);
1524}1524}
...@@ -1667,7 +1667,7 @@ pub fn getpeername(s: ws2_32.SOCKET, name: *ws2_32.sockaddr, namelen: *ws2_32.so...@@ -1667,7 +1667,7 @@ pub fn getpeername(s: ws2_32.SOCKET, name: *ws2_32.sockaddr, namelen: *ws2_32.so
16671667
1668pub fn sendmsg(1668pub fn sendmsg(
1669 s: ws2_32.SOCKET,1669 s: ws2_32.SOCKET,
1670 msg: *const ws2_32.WSAMSG,1670 msg: *ws2_32.WSAMSG_const,
1671 flags: u32,1671 flags: u32,
1672) i32 {1672) i32 {
1673 var bytes_send: DWORD = undefined;1673 var bytes_send: DWORD = undefined;
lib/std/posix.zig+2-3
...@@ -154,7 +154,6 @@ pub const socklen_t = system.socklen_t;...@@ -154,7 +154,6 @@ pub const socklen_t = system.socklen_t;
154pub const stack_t = system.stack_t;154pub const stack_t = system.stack_t;
155pub const time_t = system.time_t;155pub const time_t = system.time_t;
156pub const timespec = system.timespec;156pub const timespec = system.timespec;
157pub const timestamp_t = system.timestamp_t;
158pub const timeval = system.timeval;157pub const timeval = system.timeval;
159pub const timezone = system.timezone;158pub const timezone = system.timezone;
160pub const ucontext_t = system.ucontext_t;159pub const ucontext_t = system.ucontext_t;
...@@ -5614,7 +5613,7 @@ pub const ClockGetTimeError = error{UnsupportedClock} || UnexpectedError;...@@ -5614,7 +5613,7 @@ pub const ClockGetTimeError = error{UnsupportedClock} || UnexpectedError;
5614/// TODO: change this to return the timespec as a return value5613/// TODO: change this to return the timespec as a return value
5615pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void {5614pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void {
5616 if (native_os == .wasi and !builtin.link_libc) {5615 if (native_os == .wasi and !builtin.link_libc) {
5617 var ts: timestamp_t = undefined;5616 var ts: wasi.timestamp_t = undefined;
5618 switch (system.clock_time_get(clock_id, 1, &ts)) {5617 switch (system.clock_time_get(clock_id, 1, &ts)) {
5619 .SUCCESS => {5618 .SUCCESS => {
5620 tp.* = .{5619 tp.* = .{
...@@ -5655,7 +5654,7 @@ pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void...@@ -5655,7 +5654,7 @@ pub fn clock_gettime(clock_id: clockid_t, tp: *timespec) ClockGetTimeError!void
56555654
5656pub fn clock_getres(clock_id: clockid_t, res: *timespec) ClockGetTimeError!void {5655pub fn clock_getres(clock_id: clockid_t, res: *timespec) ClockGetTimeError!void {
5657 if (native_os == .wasi and !builtin.link_libc) {5656 if (native_os == .wasi and !builtin.link_libc) {
5658 var ts: timestamp_t = undefined;5657 var ts: wasi.timestamp_t = undefined;
5659 switch (system.clock_res_get(@bitCast(clock_id), &ts)) {5658 switch (system.clock_res_get(@bitCast(clock_id), &ts)) {
5660 .SUCCESS => res.* = .{5659 .SUCCESS => res.* = .{
5661 .sec = @intCast(ts / std.time.ns_per_s),5660 .sec = @intCast(ts / std.time.ns_per_s),