include/SDL_atomic.h
changeset 5073 1e94e68525d5
parent 5024 38638d228a22
child 5086 c2539ff054c8
     1.1 --- a/include/SDL_atomic.h	Sat Jan 22 03:57:27 2011 -0500
     1.2 +++ b/include/SDL_atomic.h	Fri Jan 21 23:46:51 2011 -0800
     1.3 @@ -56,6 +56,13 @@
     1.4  
     1.5  #include "begin_code.h"
     1.6  
     1.7 +/* Need to do this here because intrin.h has C++ code in it */
     1.8 +/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
     1.9 +#if defined(_MSC_VER) && (_MSC_VER >= 1500)
    1.10 +#include <intrin.h>
    1.11 +#define HAVE_MSC_ATOMICS
    1.12 +#endif
    1.13 +
    1.14  /* Set up for C function definitions, even when using C++ */
    1.15  #ifdef __cplusplus
    1.16  /* *INDENT-OFF* */
    1.17 @@ -112,8 +119,7 @@
    1.18   */
    1.19  #ifndef SDL_DISABLE_ATOMIC_INLINE
    1.20  
    1.21 -#if defined(_MSC_VER)
    1.22 -#include <intrin.h>
    1.23 +#if defined(HAVE_MSC_ATOMICS)
    1.24  
    1.25  #define SDL_AtomicSet(a, v)     _InterlockedExchange((long*)&(a)->value, (v))
    1.26  #define SDL_AtomicGet(a)        ((a)->value)