diff options
author | Chris Robinson <[email protected]> | 2014-03-09 03:28:00 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-03-09 03:28:00 -0700 |
commit | 372f3178f8cf1d297d88a3c39a5e2b3c78903e86 (patch) | |
tree | ec0e282c5ef936c4d1efacc88c0fc1588645e0f9 /Alc | |
parent | 74f2864c74b08fc0035271de17d585312c20443e (diff) |
Remove the Apple-specific atomic function implementations.
I'm not sure if they're even used, but they were rather ugly and are set to get
even uglier since they don't follow normal conventions (missing exchange, and
cas not returning the original value).
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/atomic.h | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/Alc/atomic.h b/Alc/atomic.h index 1dd8f9dc..83985037 100644 --- a/Alc/atomic.h +++ b/Alc/atomic.h @@ -136,42 +136,6 @@ inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval) return InterlockedCompareExchangePointer(ptr, newval, oldval) == oldval; } -#elif defined(__APPLE__) - -#include <libkern/OSAtomic.h> - -typedef int32_t RefCount; -inline RefCount IncrementRef(volatile RefCount *ptr) -{ return OSAtomicIncrement32Barrier(ptr); } -inline RefCount DecrementRef(volatile RefCount *ptr) -{ return OSAtomicDecrement32Barrier(ptr); } - -inline int ExchangeInt(volatile int *ptr, int newval) -{ - /* Really? No regular old atomic swap? */ - int oldval; - do { - oldval = *ptr; - } while(!OSAtomicCompareAndSwap32Barrier(oldval, newval, ptr)); - return oldval; -} -inline void *ExchangePtr(XchgPtr *ptr, void *newval) -{ - void *oldval; - do { - oldval = *ptr; - } while(!OSAtomicCompareAndSwapPtrBarrier(oldval, newval, ptr)); - return oldval; -} -inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int newval) -{ - return OSAtomicCompareAndSwap32Barrier(oldval, newval, ptr); -} -inline ALboolean CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval) -{ - return OSAtomicCompareAndSwapPtrBarrier(oldval, newval, ptr); -} - #else #error "No atomic functions available on this platform!" typedef ALuint RefCount; |