Remove compiler-specific C++11 compatibility macro magic
[libcds.git] / cds / compiler / clang / defs.h
1 //$$CDS-header$$
2
3 #ifndef __CDS_COMPILER_CLANG_DEFS_H
4 #define __CDS_COMPILER_CLANG_DEFS_H
5
6 // Compiler version
7 #define CDS_COMPILER_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
8
9 // Compiler name
10 #define  CDS_COMPILER__NAME    ("clang " __clang_version__)
11 #define  CDS_COMPILER__NICK    "clang"
12
13 #if defined(_LIBCPP_VERSION) && !defined(CDS_USE_BOOST_ATOMIC)
14     // Note: Clang libc++ atomic leads to program crash.
15     // So, we use libcds atomic implementation
16 #   define CDS_USE_LIBCDS_ATOMIC
17 #endif
18
19 #include <cds/compiler/gcc/compiler_macro.h>
20
21 #define alignof __alignof__
22
23 // Variadic template support (only if -std=c++0x compile-line option provided)
24 #define CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT
25
26 // Default template arguments for function templates
27 #define CDS_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS_SUPPORT
28
29 // C++11 delete definition ( function declaration = delete)
30 #define CDS_CXX11_DELETE_DEFINITION_SUPPORT
31
32 // C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]]
33 #define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
34
35 // Explicit conversion operators
36 #define CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT
37
38 // C++11 template alias
39 #define CDS_CXX11_TEMPLATE_ALIAS_SUPPORT
40
41 // C++11 inline namespace
42 #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
43
44 // Lambda
45 #define CDS_CXX11_LAMBDA_SUPPORT
46
47 // RValue
48 #define CDS_RVALUE_SUPPORT
49 #define CDS_MOVE_SEMANTICS_SUPPORT
50
51 #define CDS_CONSTEXPR    constexpr
52 #define CDS_CONSTEXPR_CONST constexpr const
53
54 #define CDS_NOEXCEPT_SUPPORT        noexcept
55 #define CDS_NOEXCEPT_SUPPORT_(expr) noexcept(expr)
56
57 // C++11 thread_local keyword
58 #define CDS_CXX11_THREAD_LOCAL_SUPPORT
59
60 // Full SFINAE support
61 #define CDS_CXX11_SFINAE
62
63 // *************************************************
64 // Alignment macro
65
66 #define CDS_TYPE_ALIGNMENT(n)   __attribute__ ((aligned (n)))
67 #define CDS_CLASS_ALIGNMENT(n)  __attribute__ ((aligned (n)))
68 #define CDS_DATA_ALIGNMENT(n)   __attribute__ ((aligned (n)))
69
70
71 #include <cds/compiler/gcc/compiler_barriers.h>
72
73 #endif // #ifndef __CDS_COMPILER_GCC_DEFS_H