diff --git a/base/runtime/os_specific_haiku.odin b/base/runtime/os_specific_haiku.odin index 0cd3938e5..c43c5d64e 100644 --- a/base/runtime/os_specific_haiku.odin +++ b/base/runtime/os_specific_haiku.odin @@ -14,7 +14,7 @@ foreign libc { _stderr_write :: proc "contextless" (data: []byte) -> (int, _OS_Errno) { ret := _unix_write(2, raw_data(data), len(data)) if ret < len(data) { - err := __error() + err := __errnop() return int(ret), _OS_Errno(err^ if err != nil else 0) } return int(ret), 0 diff --git a/core/c/libc/time.odin b/core/c/libc/time.odin index 72b899546..4c4280f30 100644 --- a/core/c/libc/time.odin +++ b/core/c/libc/time.odin @@ -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") foreign libc { // 7.27.2 Time manipulation functions diff --git a/core/os/os_haiku.odin b/core/os/os_haiku.odin new file mode 100644 index 000000000..8d77445f6 --- /dev/null +++ b/core/os/os_haiku.odin @@ -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 + diff --git a/core/time/time_unix.odin b/core/time/time_unix.odin index ba0d91527..1c46b5994 100644 --- a/core/time/time_unix.odin +++ b/core/time/time_unix.odin @@ -1,5 +1,5 @@ //+private -//+build linux, darwin, freebsd, openbsd +//+build linux, darwin, freebsd, openbsd, haiku package time import "core:sys/unix"