From a9398bf30fb3d6b15f490816f23cfca191020c5c Mon Sep 17 00:00:00 2001 From: Zachary Pierson Date: Sun, 12 Feb 2017 00:21:25 -0600 Subject: [PATCH] Tested MacOS. If a commit doesn't follow in 15 minutes, Linux works too! --- src/gb/gb.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gb/gb.h b/src/gb/gb.h index 51ad0d1e4..c8b69b3ca 100644 --- a/src/gb/gb.h +++ b/src/gb/gb.h @@ -3632,6 +3632,13 @@ gb_inline void *gb_memcopy(void *dest, void const *source, isize n) { #if defined(_MSC_VER) // TODO(bill): Is this good enough? __movsb(cast(u8 *)dest, cast(u8 *)source, n); +#elif defined(GB_SYSTEM_OSX) || defined(GB_SYSTEM_UNIX) + // NOTE(zangent): I assume there's a reason this isn't being used elsewhere, + // but casting pointers as arguments to an __asm__ call is considered an + // error on MacOS and (I think) Linux + // TODO(zangent): Figure out how to refactor the asm code so it works on MacOS, + // since this is probably not the way the author intended this to work. + memcpy(dest, source, n); #elif defined(GB_CPU_X86) __asm__ __volatile__("rep movsb" : "+D"(cast(u8 *)dest), "+S"(cast(u8 *)source), "+c"(n) : : "memory"); #else