Commit 5601ecae authored by Sam Lantinga's avatar Sam Lantinga

Whoops, good catch from Greg Jandl

parent 67334dad
...@@ -24,20 +24,12 @@ ...@@ -24,20 +24,12 @@
#include "SDL_atomic.h" #include "SDL_atomic.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#if defined(__WIN32__)
#include <intrin.h>
#elif defined(__MACOSX__)
#include <libkern/OSAtomic.h>
#endif
/* This function is where all the magic happens... */ /* This function is where all the magic happens... */
SDL_bool SDL_bool
SDL_AtomicTryLock(SDL_SpinLock *lock) SDL_AtomicTryLock(SDL_SpinLock *lock)
{ {
#if defined(__WIN32__) #if defined(_MSC_VER)
SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long)); SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long));
return (_InterlockedExchange((long*)lock, 1) == 0); return (_InterlockedExchange((long*)lock, 1) == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment