include/SDL_atomic.h
changeset 5006 8e8876e4aec6
parent 5005 7f0265279b68
child 5012 2e282002bac3
     1.1 --- a/include/SDL_atomic.h	Sun Jan 16 15:31:09 2011 -0800
     1.2 +++ b/include/SDL_atomic.h	Sun Jan 16 17:45:42 2011 -0800
     1.3 @@ -107,14 +107,16 @@
     1.4  
     1.5  /*@}*//*SDL AtomicLock*/
     1.6  
     1.7 -/* Platform specific optimized versions of the atomic functions */
     1.8 -#if defined(__WIN32__) && defined(_INC_WINDOWS)
     1.9 +/* Platform specific optimized versions of the atomic functions,
    1.10 + * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE
    1.11 + */
    1.12 +#ifndef SDL_DISABLE_ATOMIC_INLINE
    1.13 +
    1.14 +#if defined(__WIN32__)
    1.15  /* Don't include windows.h, since it may hose code that isn't expecting it,
    1.16     but if someone has already included it, this is fair game... */
    1.17 -#if 0
    1.18  #define WIN32_LEAN_AND_MEAN
    1.19  #include <windows.h>
    1.20 -#endif
    1.21  
    1.22  #define SDL_AtomicSet(a, v)     InterlockedExchange(&(a)->value, v)
    1.23  #define SDL_AtomicGet(a)        ((a)->value)
    1.24 @@ -169,6 +171,9 @@
    1.25  
    1.26  #endif
    1.27  
    1.28 +#endif /* !SDL_DISABLE_ATOMIC_INLINE */
    1.29 +
    1.30 +
    1.31  /**
    1.32   * \brief A type representing an atomic integer value.  It is a struct
    1.33   *        so people don't accidentally use numeric operations on it.