mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
fix weird errno returned on darwin
This commit is contained in:
@@ -413,7 +413,7 @@ F_OK :: 0 // Test for file existance
|
|||||||
F_GETPATH :: 50 // return the full path of the fd
|
F_GETPATH :: 50 // return the full path of the fd
|
||||||
|
|
||||||
foreign libc {
|
foreign libc {
|
||||||
@(link_name="__error") __error :: proc() -> ^int ---
|
@(link_name="__error") __error :: proc() -> ^c.int ---
|
||||||
|
|
||||||
@(link_name="open") _unix_open :: proc(path: cstring, flags: i32, mode: u16) -> Handle ---
|
@(link_name="open") _unix_open :: proc(path: cstring, flags: i32, mode: u16) -> Handle ---
|
||||||
@(link_name="close") _unix_close :: proc(handle: Handle) -> c.int ---
|
@(link_name="close") _unix_close :: proc(handle: Handle) -> c.int ---
|
||||||
@@ -489,7 +489,7 @@ foreign dl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_last_error :: proc "contextless" () -> int {
|
get_last_error :: proc "contextless" () -> int {
|
||||||
return __error()^
|
return int(__error()^)
|
||||||
}
|
}
|
||||||
|
|
||||||
get_last_error_string :: proc() -> string {
|
get_last_error_string :: proc() -> string {
|
||||||
|
|||||||
Reference in New Issue
Block a user