Begin converting os.Errno to be a nil-able type as a transition period

This commit is contained in:
gingerBill
2024-08-04 10:51:08 +01:00
parent 71932628cc
commit e60951a902
22 changed files with 1165 additions and 666 deletions
+29 -30
View File
@@ -7,7 +7,6 @@ import "base:intrinsics"
Handle :: distinct uintptr
File_Time :: distinct u64
Errno :: distinct int
INVALID_HANDLE :: ~Handle(0)
@@ -27,38 +26,38 @@ O_SYNC :: 0x01000
O_ASYNC :: 0x02000
O_CLOEXEC :: 0x80000
_Platform_Error :: win32.System_Error
ERROR_NONE: Errno : 0
ERROR_FILE_NOT_FOUND: Errno : 2
ERROR_PATH_NOT_FOUND: Errno : 3
ERROR_ACCESS_DENIED: Errno : 5
ERROR_INVALID_HANDLE: Errno : 6
ERROR_NOT_ENOUGH_MEMORY: Errno : 8
ERROR_NO_MORE_FILES: Errno : 18
ERROR_HANDLE_EOF: Errno : 38
ERROR_NETNAME_DELETED: Errno : 64
ERROR_FILE_EXISTS: Errno : 80
ERROR_INVALID_PARAMETER: Errno : 87
ERROR_BROKEN_PIPE: Errno : 109
ERROR_BUFFER_OVERFLOW: Errno : 111
ERROR_INSUFFICIENT_BUFFER: Errno : 122
ERROR_MOD_NOT_FOUND: Errno : 126
ERROR_PROC_NOT_FOUND: Errno : 127
ERROR_DIR_NOT_EMPTY: Errno : 145
ERROR_ALREADY_EXISTS: Errno : 183
ERROR_ENVVAR_NOT_FOUND: Errno : 203
ERROR_MORE_DATA: Errno : 234
ERROR_OPERATION_ABORTED: Errno : 995
ERROR_IO_PENDING: Errno : 997
ERROR_NOT_FOUND: Errno : 1168
ERROR_PRIVILEGE_NOT_HELD: Errno : 1314
WSAEACCES: Errno : 10013
WSAECONNRESET: Errno : 10054
ERROR_FILE_NOT_FOUND :: _Platform_Error(2)
ERROR_PATH_NOT_FOUND :: _Platform_Error(3)
ERROR_ACCESS_DENIED :: _Platform_Error(5)
ERROR_INVALID_HANDLE :: _Platform_Error(6)
ERROR_NOT_ENOUGH_MEMORY :: _Platform_Error(8)
ERROR_NO_MORE_FILES :: _Platform_Error(18)
ERROR_HANDLE_EOF :: _Platform_Error(38)
ERROR_NETNAME_DELETED :: _Platform_Error(64)
ERROR_FILE_EXISTS :: _Platform_Error(80)
ERROR_INVALID_PARAMETER :: _Platform_Error(87)
ERROR_BROKEN_PIPE :: _Platform_Error(109)
ERROR_BUFFER_OVERFLOW :: _Platform_Error(111)
ERROR_INSUFFICIENT_BUFFER :: _Platform_Error(122)
ERROR_MOD_NOT_FOUND :: _Platform_Error(126)
ERROR_PROC_NOT_FOUND :: _Platform_Error(127)
ERROR_DIR_NOT_EMPTY :: _Platform_Error(145)
ERROR_ALREADY_EXISTS :: _Platform_Error(183)
ERROR_ENVVAR_NOT_FOUND :: _Platform_Error(203)
ERROR_MORE_DATA :: _Platform_Error(234)
ERROR_OPERATION_ABORTED :: _Platform_Error(995)
ERROR_IO_PENDING :: _Platform_Error(997)
ERROR_NOT_FOUND :: _Platform_Error(1168)
ERROR_PRIVILEGE_NOT_HELD :: _Platform_Error(1314)
WSAEACCES :: _Platform_Error(10013)
WSAECONNRESET :: _Platform_Error(10054)
// Windows reserves errors >= 1<<29 for application use
ERROR_FILE_IS_PIPE: Errno : 1<<29 + 0
ERROR_FILE_IS_NOT_DIR: Errno : 1<<29 + 1
ERROR_NEGATIVE_OFFSET: Errno : 1<<29 + 2
ERROR_FILE_IS_PIPE :: _Platform_Error(1<<29 + 0)
ERROR_FILE_IS_NOT_DIR :: _Platform_Error(1<<29 + 1)
ERROR_NEGATIVE_OFFSET :: _Platform_Error(1<<29 + 2)
// "Argv" arguments converted to Odin strings
args := _alloc_command_line_arguments()