From b4cbb3380a750761aa0a80ab6a326bc99134109d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 11 Sep 2011 09:39:29 -0700 Subject: Fix non-GCC CompExchangePtr implementations --- OpenAL32/Include/alMain.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 3d030f94..f624cc09 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -278,9 +278,9 @@ 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) +static __inline ALboolean CompExchangePtr(void *volatile*ptr, void *oldval, void *newval) { - return InterlockedCompareExchangePointer(ptr, newval, oldval); + return InterlockedCompareExchangePointer(ptr, newval, oldval) == oldval; } #elif defined(__APPLE__) @@ -314,7 +314,7 @@ 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) +static __inline ALboolean CompExchangePtr(void *volatile*ptr, void *oldval, void *newval) { return OSAtomicCompareAndSwapPtrBarrier(oldval, newval, ptr); } -- cgit v1.2.3