fix haiku

This commit is contained in:
avanspector
2024-12-20 17:19:04 +01:00
parent 597fba7c31
commit 5376d2a20b
19 changed files with 840 additions and 225 deletions
+51 -1
View File
@@ -1,4 +1,4 @@
#+build linux, darwin, netbsd, openbsd, freebsd
#+build linux, darwin, netbsd, openbsd, freebsd, haiku
package posix
import "core:c"
@@ -554,6 +554,56 @@ when ODIN_OS == .Darwin {
sched_priority: c.int, /* [PSX] process or thread execution scheduling priority */
}
} else when ODIN_OS == .Haiku {
PTHREAD_CANCEL_ASYNCHRONOUS :: 2
PTHREAD_CANCEL_DEFERRED :: 0
PTHREAD_CANCEL_DISABLE :: 1
PTHREAD_CANCEL_ENABLE :: 0
PTHREAD_CANCELED :: rawptr(uintptr(1))
PTHREAD_CREATE_DETACHED :: 0x1
PTHREAD_CREATE_JOINABLE :: 0
PTHREAD_EXPLICIT_SCHED :: 0
PTHREAD_INHERIT_SCHED :: 0x4
PTHREAD_PRIO_INHERIT :: 1
PTHREAD_PRIO_NONE :: 0
PTHREAD_PRIO_PROTECT :: 2
PTHREAD_PROCESS_SHARED :: 1
PTHREAD_PROCESS_PRIVATE :: 0
PTHREAD_SCOPE_PROCESS :: 0
PTHREAD_SCOPE_SYSTEM :: 0x2
pthread_t :: distinct rawptr
pthread_attr_t :: distinct rawptr
pthread_key_t :: distinct c.int
pthread_mutex_t :: struct {
flags: u32,
lock: i32,
unused: i32,
owner: i32,
owner_count: i32,
}
pthread_cond_t :: struct {
flags: u32,
unused: i32,
mutex: ^pthread_mutex_t,
waiter_count: i32,
lock: i32,
}
sched_param :: struct {
sched_priority: c.int, /* [PSX] process or thread execution scheduling priority */
}
} else when ODIN_OS == .Linux {
PTHREAD_CANCEL_DEFERRED :: 0