std: fix compiler errors
Some checks are pending
ci / x86_64-linux-debug (push) Waiting to run
ci / x86_64-linux-release (push) Waiting to run
ci / aarch64-linux-debug (push) Waiting to run
ci / aarch64-linux-release (push) Waiting to run
ci / x86_64-macos-release (push) Waiting to run
ci / aarch64-macos-debug (push) Waiting to run
ci / aarch64-macos-release (push) Waiting to run
ci / x86_64-windows-debug (push) Waiting to run
ci / x86_64-windows-release (push) Waiting to run
ci / aarch64-windows (push) Waiting to run

See: #20505, #21094
This commit is contained in:
PauloCampana 2024-11-12 18:08:27 -03:00 committed by GitHub
parent 1db8cade5a
commit e6989fe637
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 9 deletions

View File

@ -8813,7 +8813,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 = 0xf0000000;
pub const EXIT_DETAIL_MASK = 0x00070000;
pub const EXIT_DECRYPTFAIL = 0x00010000;
pub const EXIT_MEMORY = 0x00020000;
@ -8947,7 +8947,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 = 0xf0000000;
/// data is seconds
pub const SECONDS = 0x00000001;
/// data is milliseconds
@ -9669,7 +9669,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;

View File

@ -1110,7 +1110,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
pub const MoveFileError = error{ FileNotFound, AccessDenied, Unexpected };
pub fn MoveFileEx(old_path: []const u8, new_path: []const u8, flags: DWORD) MoveFileError!void {
pub fn MoveFileEx(old_path: []const u8, new_path: []const u8, flags: DWORD) (MoveFileError || Wtf8ToPrefixedFileWError)!void {
const old_path_w = try sliceToPrefixedFileW(null, old_path);
const new_path_w = try sliceToPrefixedFileW(null, new_path);
return MoveFileExW(old_path_w.span().ptr, new_path_w.span().ptr, flags);
@ -1518,7 +1518,7 @@ pub const GetFileAttributesError = error{
Unexpected,
};
pub fn GetFileAttributes(filename: []const u8) GetFileAttributesError!DWORD {
pub fn GetFileAttributes(filename: []const u8) (GetFileAttributesError || Wtf8ToPrefixedFileWError)!DWORD {
const filename_w = try sliceToPrefixedFileW(null, filename);
return GetFileAttributesW(filename_w.span().ptr);
}
@ -1667,7 +1667,7 @@ pub fn getpeername(s: ws2_32.SOCKET, name: *ws2_32.sockaddr, namelen: *ws2_32.so
pub fn sendmsg(
s: ws2_32.SOCKET,
msg: *const ws2_32.WSAMSG,
msg: *ws2_32.WSAMSG_const,
flags: u32,
) i32 {
var bytes_send: DWORD = undefined;

View File

@ -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;
@ -5614,7 +5613,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.* = .{
@ -5655,7 +5654,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),