mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-12 06:18:39 +00:00
core:testing Darwin
This commit is contained in:
@@ -161,7 +161,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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user