Make SDL_atomic.h depend on the void pointer size determined at compile time
authorGabriel Jacobo <gabomdq@gmail.com>
Wed, 26 Sep 2012 15:57:28 -0300
changeset 6463 051403ca44cc
parent 6462 5e09ac1aba80
child 6464 ab55284b389f
Make SDL_atomic.h depend on the void pointer size determined at compile time rather than at configure time. As OS X supports lipo'ed versions of SDL for i386 and x86_64, a single set of headers that work for both architectures is desired.
include/SDL_atomic.h
--- a/include/SDL_atomic.h	Wed Sep 26 14:08:46 2012 -0400
+++ b/include/SDL_atomic.h	Wed Sep 26 15:57:28 2012 -0300
@@ -161,10 +161,10 @@
 #include <libkern/OSAtomic.h>
 
 #define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((oldval), (newval), &(a)->value)
-#if SIZEOF_VOIDP == 4
+#ifdef __LP64__
+#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap64Barrier((int64_t)(oldval), (int64_t)(newval), (int64_t*)(a))
+#else
 #define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((int32_t)(oldval), (int32_t)(newval), (int32_t*)(a))
-#elif SIZEOF_VOIDP == 8
-#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap64Barrier((int64_t)(oldval), (int64_t)(newval), (int64_t*)(a))
 #endif
 
 #elif defined(HAVE_GCC_ATOMICS)