diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-06 07:14:23 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-06 07:14:23 -0500 |
commit | 8ac5097c3f7c70788d175933fcbf6ca65788f16b (patch) | |
tree | c56ebab582c54cc37031e5997dc6c3d0b363bda5 /compiler.h | |
parent | 3c809e6429ccc2ccab2307ea233d039d5b785750 (diff) | |
download | gpsd-8ac5097c3f7c70788d175933fcbf6ca65788f16b.tar.gz |
Fall back to a GNUism if C11 stdatomic.h is not available but GCC is.
All regression tests pass.
Diffstat (limited to 'compiler.h')
-rw-r--r-- | compiler.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -40,6 +40,8 @@ static /*@unused@*/ inline void memory_barrier(void) #ifndef S_SPLINT_S #ifdef STD_ATOMIC_H atomic_thread_fence(memory_order_seq_cst); +#elif defined(__GNUC__) + asm volatile ("" : : : "memory"); #endif /* STD_ATOMIC_H */ #endif /* S_SPLINT_S */ } |