summaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alMain.h
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r--OpenAL32/Include/alMain.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index ae24f54c..4e596d09 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -243,6 +243,10 @@ static __inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int new
{
return __sync_bool_compare_and_swap(ptr, oldval, newval);
}
+static __inline ALboolean CompExchangePtr(void *volatile*ptr, void *oldval, void *newval)
+{
+ return __sync_bool_compare_and_swap(ptr, oldval, newval);
+}
#elif defined(_WIN32)
@@ -274,6 +278,10 @@ static __inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int new
} u = { ptr };
return InterlockedCompareExchange(u.l, newval, oldval) == oldval;
}
+static __inline void *CompExchangePtr(void *volatile*ptr, void *oldval, void *newval)
+{
+ return InterlockedCompareExchangePointer(ptr, newval, oldval);
+}
#elif defined(__APPLE__)
@@ -306,6 +314,10 @@ static __inline ALboolean CompExchangeInt(volatile int *ptr, int oldval, int new
{
return OSAtomicCompareAndSwap32Barrier(oldval, newval, ptr);
}
+static __inline ALboolean CompExchangeInt(void *volatile*ptr, void *oldval, void *newval)
+{
+ return OSAtomicCompareAndSwapPtrBarrier(oldval, newval, ptr);
+}
#else
#error "No atomic functions available on this platform!"