mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
fix core and libc
This commit is contained in:
@@ -14,7 +14,7 @@ foreign libc {
|
|||||||
_stderr_write :: proc "contextless" (data: []byte) -> (int, _OS_Errno) {
|
_stderr_write :: proc "contextless" (data: []byte) -> (int, _OS_Errno) {
|
||||||
ret := _unix_write(2, raw_data(data), len(data))
|
ret := _unix_write(2, raw_data(data), len(data))
|
||||||
if ret < len(data) {
|
if ret < len(data) {
|
||||||
err := __error()
|
err := __errnop()
|
||||||
return int(ret), _OS_Errno(err^ if err != nil else 0)
|
return int(ret), _OS_Errno(err^ if err != nil else 0)
|
||||||
}
|
}
|
||||||
return int(ret), 0
|
return int(ret), 0
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ when ODIN_OS == .Windows {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
when ODIN_OS == .Linux || ODIN_OS == .FreeBSD || ODIN_OS == .Darwin || ODIN_OS == .OpenBSD {
|
when ODIN_OS == .Linux || ODIN_OS == .FreeBSD || ODIN_OS == .Darwin || ODIN_OS == .OpenBSD || ODIN_OS == .Haiku {
|
||||||
@(default_calling_convention="c")
|
@(default_calling_convention="c")
|
||||||
foreign libc {
|
foreign libc {
|
||||||
// 7.27.2 Time manipulation functions
|
// 7.27.2 Time manipulation functions
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package os
|
||||||
|
|
||||||
|
foreign import libc "system:c"
|
||||||
|
|
||||||
|
import "core:strings"
|
||||||
|
import "core:c"
|
||||||
|
import "base:runtime"
|
||||||
|
|
||||||
|
Handle :: distinct i32
|
||||||
|
Pid :: distinct i32
|
||||||
|
File_Time :: distinct i64
|
||||||
|
Errno :: distinct i32
|
||||||
|
|
||||||
|
B_GENERAL_ERROR_BASE :: min(i32)
|
||||||
|
B_POSIX_ERROR_BASE :: B_GENERAL_ERROR_BASE + 0x7000
|
||||||
|
|
||||||
|
INVALID_HANDLE :: ~Handle(0)
|
||||||
|
|
||||||
|
ERROR_NONE: Errno: 0
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
//+private
|
//+private
|
||||||
//+build linux, darwin, freebsd, openbsd
|
//+build linux, darwin, freebsd, openbsd, haiku
|
||||||
package time
|
package time
|
||||||
|
|
||||||
import "core:sys/unix"
|
import "core:sys/unix"
|
||||||
|
|||||||
Reference in New Issue
Block a user