From d7124fef167174e75ddb6811598bb4b6192b2c47 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Tue, 28 Oct 2025 19:34:13 +0100 Subject: [PATCH] core:testing Darwin --- core/os/os2/file_posix.odin | 3 ++- core/os/os2/process_posix_darwin.odin | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/os/os2/file_posix.odin b/core/os/os2/file_posix.odin index cbf35e7fe..6e26ca252 100644 --- a/core/os/os2/file_posix.odin +++ b/core/os/os2/file_posix.odin @@ -162,7 +162,8 @@ __fd :: proc(f: ^File) -> posix.FD { return -1 } -is_tty :: proc "contextless" (f: ^File) -> bool { +_is_tty :: proc "contextless" (f: ^File) -> bool { + context = runtime.default_context() fd := _fd(f) is_tty := posix.isatty(posix.FD(fd)) return bool(is_tty) diff --git a/core/os/os2/process_posix_darwin.odin b/core/os/os2/process_posix_darwin.odin index d0be228bb..934d23711 100644 --- a/core/os/os2/process_posix_darwin.odin +++ b/core/os/os2/process_posix_darwin.odin @@ -5,12 +5,14 @@ import "base:runtime" import "base:intrinsics" import "core:bytes" +import "core:c" import "core:sys/darwin" import "core:sys/posix" import "core:sys/unix" import "core:time" -foreign import libc "system:System" +foreign import libc "system:System" +foreign import pthread "system:System" foreign libc { sysctl :: proc "c" ( @@ -33,7 +35,7 @@ _get_current_thread_id :: proc "contextless" () -> int { return int(tid) } -_processor_core_count :: proc() -> int { +_get_processor_core_count :: proc() -> int { count : int = 0 count_size := size_of(count) if _sysctlbyname("hw.logicalcpu", &count, &count_size, nil, 0) == 0 {