diff --git a/core/os/os2/errors.odin b/core/os/os2/errors.odin index f90baa699..8a2163634 100644 --- a/core/os/os2/errors.odin +++ b/core/os/os2/errors.odin @@ -30,7 +30,7 @@ General_Error :: enum u32 { Unsupported, } -Platform_Error :: enum i32 {None=0} +Platform_Error :: _Platform_Error Error :: union #shared_nil { General_Error, diff --git a/core/os/os2/errors_linux.odin b/core/os/os2/errors_linux.odin index 7f28d1c41..29815bf79 100644 --- a/core/os/os2/errors_linux.odin +++ b/core/os/os2/errors_linux.odin @@ -3,6 +3,8 @@ package os2 import "core:sys/linux" +_Platform_Error :: linux.Errno + @(rodata) _errno_strings := [linux.Errno]string{ .NONE = "", diff --git a/core/os/os2/errors_posix.odin b/core/os/os2/errors_posix.odin index 7143557a6..9e3424a4a 100644 --- a/core/os/os2/errors_posix.odin +++ b/core/os/os2/errors_posix.odin @@ -4,6 +4,8 @@ package os2 import "core:sys/posix" +_Platform_Error :: posix.Errno + _error_string :: proc(errno: i32) -> string { return string(posix.strerror(posix.Errno(errno))) } diff --git a/core/os/os2/errors_windows.odin b/core/os/os2/errors_windows.odin index 6421d26ee..6748c1167 100644 --- a/core/os/os2/errors_windows.odin +++ b/core/os/os2/errors_windows.odin @@ -5,6 +5,8 @@ import "base:runtime" import "core:slice" import win32 "core:sys/windows" +_Platform_Error :: win32.System_Error + _error_string :: proc(errno: i32) -> string { e := win32.DWORD(errno) if e == 0 { @@ -68,4 +70,4 @@ _get_platform_error :: proc() -> Error { // fallthrough } return Platform_Error(err) -} \ No newline at end of file +}