mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 12:18:15 +00:00
darwin: remove syscall usage (without -no-crt) to comply to Apple guidelines
This commit is contained in:
@@ -3,6 +3,10 @@ package darwin
|
||||
import "core:c"
|
||||
import "base:runtime"
|
||||
|
||||
// IMPORTANT NOTE: direct syscall usage is not allowed by Apple's review process of apps and should
|
||||
// be entirely avoided in the builtin Odin collections, these are here for users if they don't
|
||||
// care about the Apple review process.
|
||||
|
||||
// this package uses the sys prefix for the proc names to indicate that these aren't native syscalls but directly call such
|
||||
sys_write_string :: proc (fd: c.int, message: string) -> bool {
|
||||
return syscall_write(fd, raw_data(message), cast(u64)len(message))
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package darwin
|
||||
|
||||
// IMPORTANT NOTE: direct syscall usage is not allowed by Apple's review process of apps and should
|
||||
// be entirely avoided in the builtin Odin collections, these are here for users if they don't
|
||||
// care about the Apple review process.
|
||||
|
||||
unix_offset_syscall :: proc "contextless" (number: System_Call_Number) -> uintptr {
|
||||
return uintptr(number) + uintptr(0x2000000)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@ package darwin
|
||||
import "core:c"
|
||||
import "base:intrinsics"
|
||||
|
||||
// IMPORTANT NOTE: direct syscall usage is not allowed by Apple's review process of apps and should
|
||||
// be entirely avoided in the builtin Odin collections, these are here for users if they don't
|
||||
// care about the Apple review process.
|
||||
|
||||
/* flock */
|
||||
LOCK_SH :: 1 /* shared lock */
|
||||
LOCK_EX :: 2 /* exclusive lock */
|
||||
|
||||
Reference in New Issue
Block a user