diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-01-02 18:50:00 +0100 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-01-02 21:44:51 +0100 |
| commit | 8a7c2ea9d0e6b55bcfc5068ff2bf7c2a14ccfebf (patch) | |
| tree | a15864f5c253ef6adc9e3b995ab63e49fbb7e02c /core/runtime | |
| parent | cb1c10ce83b9a51244ad50dc7a8beb4f3271ae09 (diff) | |
darwin: actually honor no-crt by not linking with `-lSystem -lm`
Diffstat (limited to 'core/runtime')
| -rw-r--r-- | core/runtime/procs.odin | 13 |
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) |