Skip to content

Commit e6989fe

Browse files
authored
std: fix compiler errors
See: #20505, #21094
1 parent 1db8cad commit e6989fe

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

lib/std/c.zig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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;
96699669
pub const team_id = haiku.team_id;
96709670
pub const team_info = haiku.team_info;
96719671
pub const thread_id = haiku.thread_id;
9672-
pub const vregs = haiku.vregs;
96739672

96749673
pub const AUTH = openbsd.AUTH;
96759674
pub const BI = openbsd.BI;

lib/std/os/windows.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
11101110

11111111
pub const MoveFileError = error{ FileNotFound, AccessDenied, Unexpected };
11121112

1113-
pub fn MoveFileEx(old_path: []const u8, new_path: []const u8, flags: DWORD) MoveFileError!void {
1113+
pub 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

1521-
pub fn GetFileAttributes(filename: []const u8) GetFileAttributesError!DWORD {
1521+
pub 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

16681668
pub 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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ pub const socklen_t = system.socklen_t;
154154
pub const stack_t = system.stack_t;
155155
pub const time_t = system.time_t;
156156
pub const timespec = system.timespec;
157-
pub const timestamp_t = system.timestamp_t;
158157
pub const timeval = system.timeval;
159158
pub const timezone = system.timezone;
160159
pub 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
56155614
pub 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

56565655
pub 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),

0 commit comments

Comments
 (0)