include/SDL_atomic.h
changeset 5024 38638d228a22
parent 5016 cc879bc6c4cf
child 5073 1e94e68525d5
equal deleted inserted replaced
5023:5e44591800b6 5024:38638d228a22
   110 /* Platform specific optimized versions of the atomic functions,
   110 /* Platform specific optimized versions of the atomic functions,
   111  * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE
   111  * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE
   112  */
   112  */
   113 #ifndef SDL_DISABLE_ATOMIC_INLINE
   113 #ifndef SDL_DISABLE_ATOMIC_INLINE
   114 
   114 
   115 #if defined(__WIN32__)
   115 #if defined(_MSC_VER)
   116 #include <intrin.h>
   116 #include <intrin.h>
   117 
   117 
   118 #define SDL_AtomicSet(a, v)     _InterlockedExchange((long*)&(a)->value, (v))
   118 #define SDL_AtomicSet(a, v)     _InterlockedExchange((long*)&(a)->value, (v))
   119 #define SDL_AtomicGet(a)        ((a)->value)
   119 #define SDL_AtomicGet(a)        ((a)->value)
   120 #define SDL_AtomicAdd(a, v)     _InterlockedExchangeAdd((long*)&(a)->value, (v))
   120 #define SDL_AtomicAdd(a, v)     _InterlockedExchangeAdd((long*)&(a)->value, (v))