Let iOS use OSAtomicCompareAndSwap32Barrier() if nothing else is available.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 16 Oct 2011 03:02:46 -0400
changeset 5998 e9b9ef14aef4
parent 5997 69875bbf83d8
child 5999 0e3fd8178e1d
Let iOS use OSAtomicCompareAndSwap32Barrier() if nothing else is available.
src/atomic/SDL_spinlock.c
--- a/src/atomic/SDL_spinlock.c	Fri Oct 14 20:47:53 2011 -0400
+++ b/src/atomic/SDL_spinlock.c	Sun Oct 16 03:02:46 2011 -0400
@@ -81,7 +81,7 @@
         : "=r" (result) : "r" (lock), "0" (1) : "cc", "memory");
 	return (result == 0);
 
-#elif defined(__MACOSX__)
+#elif defined(__MACOSX__) || defined(__IPHONEOS__)
     /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */
     return OSAtomicCompareAndSwap32Barrier(0, 1, lock);