Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
sdl2
Browse files Browse the repository at this point in the history
- fix atomic header to compile happily under msvc 6.0
  • Loading branch information
jorgenpt committed Feb 26, 2013
1 parent 02403d3 commit 8ee7017
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/SDL_atomic.h
Expand Up @@ -126,15 +126,15 @@ 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()
#elif defined(__GNUC__)
#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,
Expand Down

0 comments on commit 8ee7017

Please sign in to comment.