aboutsummaryrefslogtreecommitdiff
path: root/core/runtime
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-01-03 17:25:41 +0000
committerGitHub <noreply@github.com>2024-01-03 17:25:41 +0000
commit0cc72b536fe31d75ebb8b73dd3e541f08fff84c1 (patch)
treea15864f5c253ef6adc9e3b995ab63e49fbb7e02c /core/runtime
parentcb1c10ce83b9a51244ad50dc7a8beb4f3271ae09 (diff)
parent8a7c2ea9d0e6b55bcfc5068ff2bf7c2a14ccfebf (diff)
Merge pull request #3066 from laytan/darwin-actually-honor-no-crt
darwin: actually honor no-crt by not linking with `-lSystem -lm`
Diffstat (limited to 'core/runtime')
-rw-r--r--core/runtime/procs.odin13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/runtime/procs.odin b/core/runtime/procs.odin
index 1592c608b..1b8a54c6d 100644
--- a/core/runtime/procs.odin
+++ b/core/runtime/procs.odin
@@ -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)