From 372f3178f8cf1d297d88a3c39a5e2b3c78903e86 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 9 Mar 2014 03:28:00 -0700 Subject: 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). --- Alc/atomic.h | 36 ------------------------------------ 1 file changed, 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 - -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; -- cgit v1.2.3