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 | f40c4cfe99d7929fa50742e353047073c8dc05d0 (patch) | |
tree | ebde1fbc3557843a9ee5df80a3efd1b7cf4bb5cf /cpp/src | |
parent | f5e1d9d0e129a804e9eb8da9e83bf7846b662e78 (diff) | |
download | qpid-python-f40c4cfe99d7929fa50742e353047073c8dc05d0.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/qpid@1101185 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/sys/AtomicValue.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/AtomicValue.h b/cpp/src/qpid/sys/AtomicValue.h index 6e90eafead..bf995f991e 100644 --- a/cpp/src/qpid/sys/AtomicValue.h +++ b/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" |