darwin: actually honor no-crt by not linking with -lSystem -lm

This commit is contained in:
Laytan Laats
2024-01-02 18:50:00 +01:00
parent cb1c10ce83
commit 8a7c2ea9d0
2 changed files with 18 additions and 4 deletions
+12 -1
View File
@@ -37,7 +37,18 @@ when ODIN_NO_CRT && ODIN_OS == .Windows {
}
return ptr
}
@(link_name="bzero", linkage="strong", require)
bzero :: proc "c" (ptr: rawptr, len: int) -> rawptr {
if ptr != nil && len != 0 {
p := ([^]byte)(ptr)
for i := 0; i < len; i += 1 {
p[i] = 0
}
}
return ptr
}
@(link_name="memmove", linkage="strong", require)
memmove :: proc "c" (dst, src: rawptr, len: int) -> rawptr {
d, s := ([^]byte)(dst), ([^]byte)(src)