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"
18 #if defined(_LIBCPP_VERSION) && !defined(CDS_USE_BOOST_ATOMIC)
19 // Note: Clang libc++ atomic leads to program crash.
20 // So, we use libcds atomic implementation
21 # define CDS_USE_LIBCDS_ATOMIC
24 #include <cds/compiler/gcc/compiler_macro.h>
26 #define alignof __alignof__
28 // Default template arguments for function templates
29 #define CDS_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS_SUPPORT
31 // C++11 delete definition ( function declaration = delete)
32 #define CDS_CXX11_DELETE_DEFINITION_SUPPORT
34 // C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]]
35 #define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
37 // C++11 inline namespace
38 #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
41 #define CDS_CXX11_LAMBDA_SUPPORT
44 #define CDS_RVALUE_SUPPORT
45 #define CDS_MOVE_SEMANTICS_SUPPORT
47 #define CDS_CONSTEXPR constexpr
48 #define CDS_CONSTEXPR_CONST constexpr const
50 #define CDS_NOEXCEPT_SUPPORT noexcept
51 #define CDS_NOEXCEPT_SUPPORT_(expr) noexcept(expr)
53 // C++11 thread_local keyword
54 #define CDS_CXX11_THREAD_LOCAL_SUPPORT
56 // Full SFINAE support
57 #define CDS_CXX11_SFINAE
59 // *************************************************
62 #define CDS_TYPE_ALIGNMENT(n) __attribute__ ((aligned (n)))
63 #define CDS_CLASS_ALIGNMENT(n) __attribute__ ((aligned (n)))
64 #define CDS_DATA_ALIGNMENT(n) __attribute__ ((aligned (n)))
67 #include <cds/compiler/gcc/compiler_barriers.h>
69 #endif // #ifndef __CDS_COMPILER_GCC_DEFS_H