diff options
| author | avanspector <avanspector@gmail.com> | 2025-01-10 07:07:40 +0100 |
|---|---|---|
| committer | avanspector <avanspector@gmail.com> | 2025-01-10 07:07:40 +0100 |
| commit | 0a985f5d02ef0821353a2bf80638519d5419d5d7 (patch) | |
| tree | 4a3c6913792199cec4eb237f44663ee7c01f5d27 /core/c | |
| parent | 9868c8292b36ef854eab7beafb1c8154d49d98f0 (diff) | |
Haiku: small fixes across core
Diffstat (limited to 'core/c')
| -rw-r--r-- | core/c/libc/stdlib.odin | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/c/libc/stdlib.odin b/core/c/libc/stdlib.odin index 98280e44b..c0e273872 100644 --- a/core/c/libc/stdlib.odin +++ b/core/c/libc/stdlib.odin @@ -42,6 +42,21 @@ when ODIN_OS == .Linux { } } +when ODIN_OS == .Haiku { + RAND_MAX :: 0x7fffffff + + // GLIBC and MUSL only + @(private="file") + @(default_calling_convention="c") + foreign libc { + __ctype_get_mb_cur_max :: proc() -> ushort --- + } + + MB_CUR_MAX :: #force_inline proc() -> size_t { + return size_t(__ctype_get_mb_cur_max()) + } +} + when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .OpenBSD { RAND_MAX :: 0x7fffffff |