summaryrefslogtreecommitdiff
path: root/compiler.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-06 07:14:23 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-06 07:14:23 -0500
commit8ac5097c3f7c70788d175933fcbf6ca65788f16b (patch)
treec56ebab582c54cc37031e5997dc6c3d0b363bda5 /compiler.h
parent3c809e6429ccc2ccab2307ea233d039d5b785750 (diff)
downloadgpsd-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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler.h b/compiler.h
index 2b5ea105..e37979f5 100644
--- a/compiler.h
+++ b/compiler.h
@@ -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 */
}