src/atomic/SDL_spinlock.c
changeset 5097 b938ad843e52
parent 5095 dceec93471e7
child 5225 5d01d426f2ea
     1.1 --- a/src/atomic/SDL_spinlock.c	Tue Jan 25 17:44:17 2011 -0800
     1.2 +++ b/src/atomic/SDL_spinlock.c	Tue Jan 25 18:02:41 2011 -0800
     1.3 @@ -37,20 +37,20 @@
     1.4      SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long));
     1.5      return (InterlockedExchange((long*)lock, 1) == 0);
     1.6  
     1.7 -#elif __MACOSX__
     1.8 +#elif defined(__MACOSX__)
     1.9      return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
    1.10  
    1.11  #elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
    1.12      return (__sync_lock_test_and_set(lock, 1) == 0);
    1.13  
    1.14 -#elif __GNUC__ && __arm__ && __ARM_ARCH_5__
    1.15 +#elif defined(__GNUC__) && defined(__arm__) && defined(__ARM_ARCH_5__)
    1.16      int result;
    1.17      __asm__ __volatile__ (
    1.18          "swp %0, %1, [%2]\n"
    1.19          : "=&r,&r" (result) : "r,0" (1), "r,r" (lock) : "memory");
    1.20      return (result == 0);
    1.21  
    1.22 -#elif __GNUC__ && __arm__
    1.23 +#elif defined(__GNUC__) && defined(__arm__)
    1.24      int result;
    1.25      __asm__ __volatile__ (
    1.26          "ldrex %0, [%2]\nteq   %0, #0\nstrexeq %0, %1, [%2]"