]> git.donarmstrong.com Git - rsem.git/blob - boost/config/compiler/clang.hpp
b57e26c5acee9dfcf30c8a88dd8e8021701e5efe
[rsem.git] / boost / config / compiler / clang.hpp
1 // (C) Copyright Douglas Gregor 2010
2 //
3 //  Use, modification and distribution are subject to the
4 //  Boost Software License, Version 1.0. (See accompanying file
5 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 //  See http://www.boost.org for most recent version.
8
9 // Clang compiler setup.
10
11 #define BOOST_HAS_PRAGMA_ONCE
12
13 #if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
14 #  define BOOST_NO_EXCEPTIONS
15 #endif
16
17 #if !__has_feature(cxx_rtti) && !defined(BOOST_NO_RTTI)
18 #  define BOOST_NO_RTTI
19 #endif
20
21 #if !__has_feature(cxx_rtti) && !defined(BOOST_NO_TYPEID)
22 #  define BOOST_NO_TYPEID
23 #endif
24
25 #if defined(__int64) && !defined(__GNUC__)
26 #  define BOOST_HAS_MS_INT64
27 #endif
28
29 #define BOOST_HAS_NRVO
30
31 // Branch prediction hints
32 #if defined(__has_builtin)
33 #if __has_builtin(__builtin_expect)
34 #define BOOST_LIKELY(x) __builtin_expect(x, 1)
35 #define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
36 #endif
37 #endif
38
39 // Clang supports "long long" in all compilation modes.
40 #define BOOST_HAS_LONG_LONG
41
42 //
43 // Dynamic shared object (DSO) and dynamic-link library (DLL) support
44 //
45 #if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
46 #  define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
47 #  define BOOST_SYMBOL_IMPORT
48 #  define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
49 #endif
50
51 //
52 // The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through
53 // between switch labels.
54 //
55 #if __cplusplus >= 201103L && defined(__has_warning)
56 #  if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
57 #    define BOOST_FALLTHROUGH [[clang::fallthrough]]
58 #  endif
59 #endif
60
61 #if !__has_feature(cxx_auto_type)
62 #  define BOOST_NO_CXX11_AUTO_DECLARATIONS
63 #  define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
64 #endif
65
66 #if !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
67 #  define BOOST_NO_CXX11_CHAR16_T
68 #  define BOOST_NO_CXX11_CHAR32_T
69 #endif
70
71 #if !__has_feature(cxx_constexpr)
72 #  define BOOST_NO_CXX11_CONSTEXPR
73 #endif
74
75 #if !__has_feature(cxx_decltype)
76 #  define BOOST_NO_CXX11_DECLTYPE
77 #endif
78
79 #if !__has_feature(cxx_decltype_incomplete_return_types)
80 #  define BOOST_NO_CXX11_DECLTYPE_N3276
81 #endif
82
83 #if !__has_feature(cxx_defaulted_functions)
84 #  define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
85 #endif
86
87 #if !__has_feature(cxx_deleted_functions)
88 #  define BOOST_NO_CXX11_DELETED_FUNCTIONS
89 #endif
90
91 #if !__has_feature(cxx_explicit_conversions)
92 #  define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
93 #endif
94
95 #if !__has_feature(cxx_default_function_template_args)
96 #  define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
97 #endif
98
99 #if !__has_feature(cxx_generalized_initializers)
100 #  define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
101 #endif
102
103 #if !__has_feature(cxx_lambdas)
104 #  define BOOST_NO_CXX11_LAMBDAS
105 #endif
106
107 #if !__has_feature(cxx_local_type_template_args)
108 #  define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
109 #endif
110
111 #if !__has_feature(cxx_noexcept)
112 #  define BOOST_NO_CXX11_NOEXCEPT
113 #endif
114
115 #if !__has_feature(cxx_nullptr)
116 #  define BOOST_NO_CXX11_NULLPTR
117 #endif
118
119 #if !__has_feature(cxx_range_for)
120 #  define BOOST_NO_CXX11_RANGE_BASED_FOR
121 #endif
122
123 #if !__has_feature(cxx_raw_string_literals)
124 #  define BOOST_NO_CXX11_RAW_LITERALS
125 #endif
126
127 #if !__has_feature(cxx_generalized_initializers)
128 #  define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
129 #endif
130
131 #if !__has_feature(cxx_rvalue_references)
132 #  define BOOST_NO_CXX11_RVALUE_REFERENCES
133 #endif
134
135 #if !__has_feature(cxx_strong_enums)
136 #  define BOOST_NO_CXX11_SCOPED_ENUMS
137 #endif
138
139 #if !__has_feature(cxx_static_assert)
140 #  define BOOST_NO_CXX11_STATIC_ASSERT
141 #endif
142
143 #if !__has_feature(cxx_alias_templates)
144 #  define BOOST_NO_CXX11_TEMPLATE_ALIASES
145 #endif
146
147 #if !__has_feature(cxx_unicode_literals)
148 #  define BOOST_NO_CXX11_UNICODE_LITERALS
149 #endif
150
151 #if !__has_feature(cxx_variadic_templates)
152 #  define BOOST_NO_CXX11_VARIADIC_TEMPLATES
153 #endif
154
155 #if !__has_feature(cxx_user_literals)
156 #  define BOOST_NO_CXX11_USER_DEFINED_LITERALS
157 #endif
158
159 #if !(__has_feature(cxx_alignas) || __has_extension(cxx_alignas))
160 #  define BOOST_NO_CXX11_ALIGNAS
161 #endif
162
163 #if !__has_feature(cxx_trailing_return)
164 #  define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
165 #endif
166
167 #if !__has_feature(cxx_inline_namespaces)
168 #  define BOOST_NO_CXX11_INLINE_NAMESPACES
169 #endif
170
171 // Clang always supports variadic macros
172 // Clang always supports extern templates
173
174 #ifndef BOOST_COMPILER
175 #  define BOOST_COMPILER "Clang version " __clang_version__
176 #endif
177
178 // Macro used to identify the Clang compiler.
179 #define BOOST_CLANG 1
180