Add atomics for Watcom/x86 as inline asm

Partially fixes Bugzilla #3758.
This commit is contained in:
Ozkan Sezer 2017-08-18 16:35:55 -04:00
parent c68d3ab785
commit 500378eb52
3 changed files with 56 additions and 1 deletions

View file

@ -125,6 +125,9 @@ void _ReadWriteBarrier(void);
#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
#elif defined(__WATCOMC__)
extern _inline void SDL_CompilerBarrier (void);
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
#else
#define SDL_CompilerBarrier() \
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }