diff options
| author | avanspector <avanspector@gmail.com> | 2024-12-20 17:19:04 +0100 |
|---|---|---|
| committer | avanspector <avanspector@gmail.com> | 2024-12-20 17:19:04 +0100 |
| commit | 5376d2a20b74e84967cad87ba8ee3cb3bfff4930 (patch) | |
| tree | d372077855ce6a8b6c3da259edd4cf33fabd22c1 /core/c | |
| parent | 597fba7c31f5e927b0c7431444dad132352b4046 (diff) | |
fix haiku
Diffstat (limited to 'core/c')
| -rw-r--r-- | core/c/libc/errno.odin | 15 | ||||
| -rw-r--r-- | core/c/libc/locale.odin | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/core/c/libc/errno.odin b/core/c/libc/errno.odin index de429a6ec..5d1ca8248 100644 --- a/core/c/libc/errno.odin +++ b/core/c/libc/errno.odin @@ -88,14 +88,15 @@ when ODIN_OS == .Haiku { _get_errno :: proc() -> ^int --- } - @(private="file") - B_GENERAL_ERROR_BASE :: min(i32) - @(private="file") - B_POSIX_ERROR_BASE :: B_GENERAL_ERROR_BASE + 0x7000 + _HAIKU_USE_POSITIVE_POSIX_ERRORS :: #config(HAIKU_USE_POSITIVE_POSIX_ERRORS, false) + _POSIX_ERROR_FACTOR :: -1 when _HAIKU_USE_POSITIVE_POSIX_ERRORS else 1 + + @(private="file") _GENERAL_ERROR_BASE :: min(int) + @(private="file") _POSIX_ERROR_BASE :: _GENERAL_ERROR_BASE + 0x7000 - EDOM :: B_POSIX_ERROR_BASE + 16 - EILSEQ :: B_POSIX_ERROR_BASE + 38 - ERANGE :: B_POSIX_ERROR_BASE + 17 + EDOM :: _POSIX_ERROR_FACTOR * (_POSIX_ERROR_BASE + 16) + EILSEQ :: _POSIX_ERROR_FACTOR * (_POSIX_ERROR_BASE + 38) + ERANGE :: _POSIX_ERROR_FACTOR * (_POSIX_ERROR_BASE + 17) } when ODIN_OS == .JS { diff --git a/core/c/libc/locale.odin b/core/c/libc/locale.odin index 371d755c5..d95f5c164 100644 --- a/core/c/libc/locale.odin +++ b/core/c/libc/locale.odin @@ -110,7 +110,7 @@ when ODIN_OS == .Windows { } } -when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS == .OpenBSD || ODIN_OS == .Windows { +when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS == .OpenBSD || ODIN_OS == .Haiku || ODIN_OS == .Windows { LC_ALL :: 0 LC_COLLATE :: 1 |