include/SDL_atomic.h
changeset 6463 051403ca44cc
parent 6430 48d519500f7e
child 6885 700f1b25f77f
     1.1 --- a/include/SDL_atomic.h	Wed Sep 26 14:08:46 2012 -0400
     1.2 +++ b/include/SDL_atomic.h	Wed Sep 26 15:57:28 2012 -0300
     1.3 @@ -161,10 +161,10 @@
     1.4  #include <libkern/OSAtomic.h>
     1.5  
     1.6  #define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((oldval), (newval), &(a)->value)
     1.7 -#if SIZEOF_VOIDP == 4
     1.8 +#ifdef __LP64__
     1.9 +#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap64Barrier((int64_t)(oldval), (int64_t)(newval), (int64_t*)(a))
    1.10 +#else
    1.11  #define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((int32_t)(oldval), (int32_t)(newval), (int32_t*)(a))
    1.12 -#elif SIZEOF_VOIDP == 8
    1.13 -#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap64Barrier((int64_t)(oldval), (int64_t)(newval), (int64_t*)(a))
    1.14  #endif
    1.15  
    1.16  #elif defined(HAVE_GCC_ATOMICS)