summaryrefslogtreecommitdiff
path: root/lib/ovs-atomic.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2014-11-11 08:19:27 -0800
committerBen Pfaff <blp@nicira.com>2014-11-11 13:55:02 -0800
commit07ece367fb5fe071fa75a426a3ce28e3b4ce04ba (patch)
tree74a9119cc52c8871063f08744feb29aa1cd92b6f /lib/ovs-atomic.h
parent50b9699fe49b66de64d0d0b1803bb13e95ca2c2e (diff)
downloadopenvswitch-07ece367fb5fe071fa75a426a3ce28e3b4ce04ba.tar.gz
ovs-atomic: Prefer Clang intrinsics over <stdatomic.h>.
On my Debian "jessie" system, <stdatomic.h> provided by GCC 4.9 is busted when Clang 3.5 tries to use it. Even a trivial program like this: #include <stdatomic.h> void foo(void) { _Atomic(int) x; atomic_fetch_add(&x, 1); } yields: atomic.c:7:5: error: address argument to atomic operation must be a pointer to integer or pointer ('_Atomic(int) *' invalid) The Clang-specific version of ovs-atomic.h stills works, though, so this commit works around the problem. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Diffstat (limited to 'lib/ovs-atomic.h')
-rw-r--r--lib/ovs-atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h
index 6a213727f..9ead90779 100644
--- a/lib/ovs-atomic.h
+++ b/lib/ovs-atomic.h
@@ -321,10 +321,10 @@
#if __CHECKER__
/* sparse doesn't understand some GCC extensions we use. */
#include "ovs-atomic-pthreads.h"
- #elif HAVE_STDATOMIC_H
- #include "ovs-atomic-c11.h"
#elif __has_extension(c_atomic)
#include "ovs-atomic-clang.h"
+ #elif HAVE_STDATOMIC_H
+ #include "ovs-atomic-c11.h"
#elif __GNUC__ >= 4 && __GNUC_MINOR__ >= 7
#include "ovs-atomic-gcc4.7+.h"
#elif __GNUC__ && defined(__x86_64__)