From b267a5964d014c870ccfa3f068410351d07256fa Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 31 Dec 2019 14:28:01 +0000 Subject: [PATCH] Fix memset for unix --- core/runtime/{procs_everything_else.odin => procs_unix.odin} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename core/runtime/{procs_everything_else.odin => procs_unix.odin} (77%) diff --git a/core/runtime/procs_everything_else.odin b/core/runtime/procs_unix.odin similarity index 77% rename from core/runtime/procs_everything_else.odin rename to core/runtime/procs_unix.odin index 18c12c517..9ad3cdb21 100644 --- a/core/runtime/procs_everything_else.odin +++ b/core/runtime/procs_unix.odin @@ -1,4 +1,4 @@ -//+build !windows +//+build linux, darwin package runtime @(link_name="memset") @@ -6,7 +6,7 @@ memset :: proc "c" (ptr: rawptr, val: i32, len: int) -> rawptr { b := byte(val); p_start := uintptr(ptr); - p_end := p + uintptr(max(len, 0)); + p_end := p_start + uintptr(max(len, 0)); for p := p_start; p < p_end; p += 1 { (^byte)(p)^ = b; }