summaryrefslogtreecommitdiff
path: root/include/SDL_atomic.h
diff options
context:
space:
mode:
authorJ?rgen P. Tjern? <jorgen@valvesoftware.com>2013-02-25 16:52:48 -0800
committerJ?rgen P. Tjern? <jorgen@valvesoftware.com>2013-02-25 16:52:48 -0800
commit53ee774a9f1d2da11c8875c2d52c6fe37e8d6854 (patch)
tree4660c4351b6d83db621c78facf6ff649bac7400f /include/SDL_atomic.h
parent647d754a2c298b5a0211f6fa87188c64897a1851 (diff)
downloadsdl-53ee774a9f1d2da11c8875c2d52c6fe37e8d6854.tar.gz
sdl2
- fix atomic header to compile happily under msvc 6.0
Diffstat (limited to 'include/SDL_atomic.h')
-rw-r--r--include/SDL_atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/SDL_atomic.h b/include/SDL_atomic.h
index 2f1734963..bba530102 100644
--- a/include/SDL_atomic.h
+++ b/include/SDL_atomic.h
@@ -126,7 +126,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
* The compiler barrier prevents the compiler from reordering
* reads and writes to globally visible variables across the call.
*/
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && (_MSC_VER > 1200)
void _ReadWriteBarrier(void);
#pragma intrinsic(_ReadWriteBarrier)
#define SDL_CompilerBarrier() _ReadWriteBarrier()
@@ -134,7 +134,7 @@ void _ReadWriteBarrier(void);
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
#else
#define SDL_CompilerBarrier() \
-({ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); })
+{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
#endif
/* Platform specific optimized versions of the atomic functions,