From f40c4cfe99d7929fa50742e353047073c8dc05d0 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Mon, 9 May 2011 19:56:29 +0000 Subject: 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 --- cpp/src/qpid/sys/AtomicValue.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cpp/src') 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" -- cgit v1.2.1