diff options
author | Andrew Stitcher <astitcher@apache.org> | 2011-05-09 19:56:29 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2011-05-09 19:56:29 +0000 |
commit | 4e15e5fc5ce3990146cc8f5ca0873cf5ede1db0e (patch) | |
tree | 5aeca45c99af91e67b7b04167e9bdd4e0fa963fa | |
parent | 7bfe51aa2850d8f3623fb439caa8ce123aba0a4e (diff) | |
download | qpid-python-4e15e5fc5ce3990146cc8f5ca0873cf5ede1db0e.tar.gz |
QPID-3004: Get Clang to compile qpid c++
- Make clang use slow mutex protected AtomicValue
This is the simplest solution to clang not supporting 64 bit
atomic builtins.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1101185 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/sys/AtomicValue.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/sys/AtomicValue.h b/qpid/cpp/src/qpid/sys/AtomicValue.h index 6e90eafead..bf995f991e 100644 --- a/qpid/cpp/src/qpid/sys/AtomicValue.h +++ b/qpid/cpp/src/qpid/sys/AtomicValue.h @@ -22,7 +22,12 @@ * */ -#if defined( __GNUC__ ) && __GNUC__ >= 4 && ( defined( __i686__ ) || defined( __x86_64__ ) ) +// Have to check for clang before gcc as clang pretends to be gcc too +#if defined( __clang__ ) +// Use the clang doesn't support atomic builtins for 64 bit values, so use the slow versions +#include "qpid/sys/AtomicValue_mutex.h" + +#elif defined( __GNUC__ ) && __GNUC__ >= 4 && ( defined( __i686__ ) || defined( __x86_64__ ) ) // Use the Gnu C built-in atomic operations if compiling with gcc on a suitable platform. #include "qpid/sys/AtomicValue_gcc.h" |