Compare commits

..

1 Commits

Author SHA1 Message Date
RiskyMH
7c4948ff7d deps: update libarchive to v3.8.5 (dd897a78c662a2c7a003e7ec158cea7909557bee) 2026-03-01 03:52:59 +00:00
3 changed files with 6 additions and 12 deletions

View File

@@ -4,7 +4,7 @@ register_repository(
REPOSITORY
libarchive/libarchive
COMMIT
9525f90ca4bd14c7b335e2f8c84a4607b0af6bdf
dd897a78c662a2c7a003e7ec158cea7909557bee
)
register_cmake_command(

View File

@@ -968,7 +968,7 @@ pub const SystemErrno = enum(u16) {
if (@TypeOf(code) == u16 or (@TypeOf(code) == c_int and code > 0)) {
// Win32Error and WSA Error codes
if (code <= @intFromEnum(Win32Error.IO_REISSUE_AS_CACHED) or (code >= @intFromEnum(Win32Error.WSAEINTR) and code <= @intFromEnum(Win32Error.WSA_QOS_RESERVED_PETYPE))) {
return init(std.meta.intToEnum(Win32Error, code) catch return null);
return init(@as(Win32Error, @enumFromInt(code)));
} else {
// uv error codes
inline for (@typeInfo(SystemErrno).@"enum".fields) |field| {
@@ -988,7 +988,7 @@ pub const SystemErrno = enum(u16) {
}
if (comptime @TypeOf(code) == Win32Error or @TypeOf(code) == std.os.windows.Win32Error) {
return switch (std.meta.intToEnum(Win32Error, @intFromEnum(code)) catch return null) {
return switch (@as(Win32Error, @enumFromInt(@intFromEnum(code)))) {
Win32Error.NOACCESS => SystemErrno.EACCES,
Win32Error.WSAEACCES => SystemErrno.EACCES,
Win32Error.ELEVATION_REQUIRED => SystemErrno.EACCES,

View File

@@ -149,7 +149,7 @@ pub extern "kernel32" fn SetCurrentDirectoryW(
lpPathName: win32.LPCWSTR,
) callconv(.winapi) win32.BOOL;
pub const SetCurrentDirectory = SetCurrentDirectoryW;
pub extern "ntdll" fn RtlNtStatusToDosError(win32.NTSTATUS) callconv(.winapi) u32;
pub extern "ntdll" fn RtlNtStatusToDosError(win32.NTSTATUS) callconv(.winapi) Win32Error;
pub extern "advapi32" fn SaferiIsExecutableFileType(szFullPathname: win32.LPCWSTR, bFromShellExecute: win32.BOOLEAN) callconv(.winapi) win32.BOOL;
// This was originally copied from Zig's standard library
/// Codes are from https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d
@@ -2952,8 +2952,7 @@ pub const Win32Error = enum(u16) {
pub const WSA_QOS_RESERVED_PETYPE: Win32Error = @enumFromInt(11031);
pub fn get() Win32Error {
const raw: u16 = @intFromEnum(bun.windows.kernel32.GetLastError());
return std.meta.intToEnum(Win32Error, raw) catch .MR_MID_NOT_FOUND;
return @enumFromInt(@intFromEnum(bun.windows.kernel32.GetLastError()));
}
pub fn int(this: Win32Error) u16 {
@@ -2972,12 +2971,7 @@ pub const Win32Error = enum(u16) {
}
pub fn fromNTStatus(status: win32.NTSTATUS) Win32Error {
// RtlNtStatusToDosError returns a u32 Win32 error code that may not be
// in our Win32Error enum subset. Safely convert to avoid panic on
// invalid enum values.
const raw = RtlNtStatusToDosError(status);
if (raw > std.math.maxInt(u16)) return .MR_MID_NOT_FOUND;
return std.meta.intToEnum(Win32Error, @as(u16, @intCast(raw))) catch .MR_MID_NOT_FOUND;
return RtlNtStatusToDosError(status);
}
};