Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Make SDL_atomic.h depend on the void pointer size determined at compi…
Browse files Browse the repository at this point in the history
…le 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.
  • Loading branch information
gabomdq committed Sep 26, 2012
1 parent a8442cf commit 30a09c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/SDL_atomic.h
Expand Up @@ -161,10 +161,10 @@ void _ReadWriteBarrier(void);
#include <libkern/OSAtomic.h>

#define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((oldval), (newval), &(a)->value)
#if SIZEOF_VOIDP == 4
#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((int32_t)(oldval), (int32_t)(newval), (int32_t*)(a))
#elif SIZEOF_VOIDP == 8
#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))
#endif

#elif defined(HAVE_GCC_ATOMICS)
Expand Down

0 comments on commit 30a09c9

Please sign in to comment.