mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
implement bsd's, same as darwin
This commit is contained in:
@@ -1,19 +1,24 @@
|
|||||||
//+private
|
//+private
|
||||||
|
//+build darwin, freebsd, openbsd
|
||||||
package spall
|
package spall
|
||||||
|
|
||||||
// Only for types.
|
// Only for types.
|
||||||
import "core:os"
|
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 {
|
timespec :: struct {
|
||||||
tv_sec: i64, // seconds
|
tv_sec: i64, // seconds
|
||||||
tv_nsec: i64, // nanoseconds
|
tv_nsec: i64, // nanoseconds
|
||||||
}
|
}
|
||||||
|
|
||||||
foreign system {
|
foreign libc {
|
||||||
@(link_name="__error") __error :: proc() -> ^i32 ---
|
__error :: proc() -> ^i32 ---
|
||||||
@(link_name="write") _unix_write :: proc(handle: os.Handle, buffer: rawptr, count: uint) -> int ---
|
@(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 ---
|
@(link_name="clock_gettime") _unix_clock_gettime :: proc(clock_id: u64, timespec: ^timespec) -> i32 ---
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user