diff options
| author | hikari <ftphikari@gmail.com> | 2022-04-16 14:35:49 +0300 |
|---|---|---|
| committer | hikari <ftphikari@gmail.com> | 2022-04-16 14:35:49 +0300 |
| commit | 4f4793817cfb1782c1b2e6cf55ffdbfb01bcffaf (patch) | |
| tree | 54cb5d0de0b3e622afcf32e489e3ad5ae5aa01c1 /core | |
| parent | 0a0440a6e869e8d8791608f14fb55f37f323a23e (diff) | |
time: fix unix build
Diffstat (limited to 'core')
| -rw-r--r-- | core/time/time_unix.odin | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/core/time/time_unix.odin b/core/time/time_unix.odin index db15a824a..0cfa196a2 100644 --- a/core/time/time_unix.odin +++ b/core/time/time_unix.odin @@ -1,8 +1,6 @@ //+build linux, darwin, freebsd, openbsd package time -import "core:sys/unix" - IS_SUPPORTED :: true // NOTE: Times on Darwin are UTC. when ODIN_OS == .Darwin { @@ -19,8 +17,18 @@ foreign libc { @(link_name="nanosleep") _unix_nanosleep :: proc(requested: ^TimeSpec, remaining: ^TimeSpec) -> i32 --- } +foreign import "system:pthread" + +import "core:c" + +@(private="file") +@(default_calling_convention="c") +foreign pthread { + sched_yield :: proc() -> c.int --- +} + _yield :: proc "contextless" () { - unix.sched_yield() + sched_yield() } TimeSpec :: struct { |