sdl2
- fix atomic header to compile happily under msvc 6.0
This commit is contained in:
parent
cf58b77360
commit
a3482e3ac0
1 changed files with 2 additions and 2 deletions
|
@ -126,7 +126,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
||||||
* The compiler barrier prevents the compiler from reordering
|
* The compiler barrier prevents the compiler from reordering
|
||||||
* reads and writes to globally visible variables across the call.
|
* reads and writes to globally visible variables across the call.
|
||||||
*/
|
*/
|
||||||
#ifdef _MSC_VER
|
#if defined(_MSC_VER) && (_MSC_VER > 1200)
|
||||||
void _ReadWriteBarrier(void);
|
void _ReadWriteBarrier(void);
|
||||||
#pragma intrinsic(_ReadWriteBarrier)
|
#pragma intrinsic(_ReadWriteBarrier)
|
||||||
#define SDL_CompilerBarrier() _ReadWriteBarrier()
|
#define SDL_CompilerBarrier() _ReadWriteBarrier()
|
||||||
|
@ -134,7 +134,7 @@ void _ReadWriteBarrier(void);
|
||||||
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
|
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
|
||||||
#else
|
#else
|
||||||
#define SDL_CompilerBarrier() \
|
#define SDL_CompilerBarrier() \
|
||||||
({ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); })
|
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Platform specific optimized versions of the atomic functions,
|
/* Platform specific optimized versions of the atomic functions,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue