Remove the use of import within when

This commit is contained in:
gingerBill
2023-08-04 15:54:44 +01:00
parent 3323d5c76c
commit 9aed26a234
10 changed files with 43 additions and 41 deletions
-24
View File
@@ -276,30 +276,6 @@ thread_priority :: enum c.int {
realtime = 1,
default = 0,
}
when ODIN_OS == .Windows {
thread :: distinct rawptr
mutex :: distinct rawptr
event :: distinct rawptr
semaphore :: distinct rawptr
} else {
import "core:sys/unix"
thread :: unix.pthread_t
mutex :: unix.pthread_mutex_t
event :: struct {
value: u32,
lock: unix.pthread_mutex_t,
cond: unix.pthread_cond_t,
}
semaphore :: struct {
value: c.int,
lock: unix.pthread_mutex_t,
cond: unix.pthread_cond_t,
}
}
} /* NO_THREADING */
+17
View File
@@ -0,0 +1,17 @@
//+build !windows
package miniaudio
import "core:sys/unix"
thread :: unix.pthread_t
mutex :: unix.pthread_mutex_t
event :: struct {
value: u32,
lock: unix.pthread_mutex_t,
cond: unix.pthread_cond_t,
}
semaphore :: struct {
value: c.int,
lock: unix.pthread_mutex_t,
cond: unix.pthread_cond_t,
}
+6
View File
@@ -0,0 +1,6 @@
package miniaudio
thread :: distinct rawptr
mutex :: distinct rawptr
event :: distinct rawptr
semaphore :: distinct rawptr