mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-18 03:58:54 +00:00
atomic: Use __atomic_signal_fence() for SDL_CompilerBarrier()
This is the (slightly) more standard way to accomplish it.
This commit is contained in:
parent
3308183dfa
commit
d5acd7f123
1 changed files with 2 additions and 0 deletions
|
|
@ -156,6 +156,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);
|
|||
*/
|
||||
#define SDL_CompilerBarrier() DoCompilerSpecificReadWriteBarrier()
|
||||
|
||||
#elif SDL_HAS_BUILTIN(__atomic_signal_fence) || (defined(__GNUC__) && (__GNUC__ >= 5))
|
||||
#define SDL_CompilerBarrier() __atomic_signal_fence(__ATOMIC_SEQ_CST)
|
||||
#elif defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
|
||||
void _ReadWriteBarrier(void);
|
||||
#pragma intrinsic(_ReadWriteBarrier)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue