diff options
| author | Laytan <laytanlaats@hotmail.com> | 2024-02-05 18:48:17 +0100 |
|---|---|---|
| committer | Laytan <laytanlaats@hotmail.com> | 2024-02-05 18:48:17 +0100 |
| commit | e63d71c23b0d86ec40dcdf8fdd6cec11fd232d8e (patch) | |
| tree | e63ac1762778082d2194776b59899acfdd44572b /core/prof | |
| parent | ca6300c8600734f9f294ddc8533f817211ad4cb5 (diff) | |
implement bsd's, same as darwin
Diffstat (limited to 'core/prof')
| -rw-r--r-- | core/prof/spall/spall_unix.odin (renamed from core/prof/spall/spall_darwin.odin) | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/prof/spall/spall_darwin.odin b/core/prof/spall/spall_unix.odin index 5af50f57a..7915f8c32 100644 --- a/core/prof/spall/spall_darwin.odin +++ b/core/prof/spall/spall_unix.odin @@ -1,19 +1,24 @@ //+private +//+build darwin, freebsd, openbsd package spall // Only for types. import "core:os" -foreign import system "system:System.framework" +when ODIN_OS == .Darwin { + foreign import libc "system:System.framework" +} else { + foreign import libc "system:c" +} timespec :: struct { tv_sec: i64, // seconds tv_nsec: i64, // nanoseconds } -foreign system { - @(link_name="__error") __error :: proc() -> ^i32 --- - @(link_name="write") _unix_write :: proc(handle: os.Handle, buffer: rawptr, count: uint) -> int --- +foreign libc { + __error :: proc() -> ^i32 --- + @(link_name="write") _unix_write :: proc(handle: os.Handle, buffer: rawptr, count: uint) -> int --- @(link_name="clock_gettime") _unix_clock_gettime :: proc(clock_id: u64, timespec: ^timespec) -> i32 --- } |