3 #ifndef __CDS_COMPILER_CLANG_DEFS_H
4 #define __CDS_COMPILER_CLANG_DEFS_H
7 #define CDS_COMPILER_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
10 #define CDS_COMPILER__NAME ("clang " __clang_version__)
11 #define CDS_COMPILER__NICK "clang"
13 #if CDS_COMPILER_VERSION < 30300
14 # error "Compiler version error. Clang version 3.3.0 and above is supported"
17 #if defined(_LIBCPP_VERSION) && !defined(CDS_USE_BOOST_ATOMIC)
18 // Note: Clang libc++ atomic leads to program crash.
19 // So, we use libcds atomic implementation
20 # define CDS_USE_LIBCDS_ATOMIC
23 #include <cds/compiler/gcc/compiler_macro.h>
25 #if CDS_COMPILER_VERSION >= 30400 && CDS_COMPILER_VERSION < 30500 && CDS_PROCESSOR_ARCH == CDS_PROCESSOR_AMD64
26 // Error compiling 64bit boost.atomic on clang 3.4 - 3.5
27 // see https://svn.boost.org/trac/boost/ticket/9610
28 # define BOOST_HAS_INT128 1
31 #define alignof __alignof__
33 // C++11 inline namespace
34 #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
36 #define CDS_CONSTEXPR constexpr
37 #define CDS_CONSTEXPR_CONST constexpr const
39 #define CDS_NOEXCEPT_SUPPORT noexcept
40 #define CDS_NOEXCEPT_SUPPORT_(expr) noexcept(expr)
42 // C++11 thread_local keyword
43 #define CDS_CXX11_THREAD_LOCAL_SUPPORT
45 // Full SFINAE support
46 #define CDS_CXX11_SFINAE
48 // *************************************************
51 #define CDS_TYPE_ALIGNMENT(n) __attribute__ ((aligned (n)))
52 #define CDS_CLASS_ALIGNMENT(n) __attribute__ ((aligned (n)))
53 #define CDS_DATA_ALIGNMENT(n) __attribute__ ((aligned (n)))
56 #include <cds/compiler/gcc/compiler_barriers.h>
58 #endif // #ifndef __CDS_COMPILER_GCC_DEFS_H