blob: 8e38821bdd30963bf51460221943799401db20a3 [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// (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#if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
12# define BOOST_NO_EXCEPTIONS
13#endif
14
15#if !__has_feature(cxx_rtti) && !defined(BOOST_NO_RTTI)
16# define BOOST_NO_RTTI
17#endif
18
19#if !__has_feature(cxx_rtti) && !defined(BOOST_NO_TYPEID)
20# define BOOST_NO_TYPEID
21#endif
22
Jeff Thompsona28eed82013-08-22 16:21:10 -070023#if defined(__int64) && !defined(__GNUC__)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070024# define BOOST_HAS_MS_INT64
25#endif
26
27#define BOOST_HAS_NRVO
28
29// Clang supports "long long" in all compilation modes.
30#define BOOST_HAS_LONG_LONG
31
32//
33// Dynamic shared object (DSO) and dynamic-link library (DLL) support
34//
35#if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
36# define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
37# define BOOST_SYMBOL_IMPORT
38# define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
39#endif
40
Jeff Thompsona28eed82013-08-22 16:21:10 -070041//
42// The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through
43// between switch labels.
44//
45#if __cplusplus >= 201103L && defined(__has_warning)
46# if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
47# define BOOST_FALLTHROUGH [[clang::fallthrough]]
48# endif
49#endif
50
Jeff Thompsonf7d49942013-08-01 16:47:40 -070051#if !__has_feature(cxx_auto_type)
52# define BOOST_NO_CXX11_AUTO_DECLARATIONS
53# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
54#endif
55
56#if !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
57# define BOOST_NO_CXX11_CHAR16_T
58# define BOOST_NO_CXX11_CHAR32_T
59#endif
60
61#if !__has_feature(cxx_constexpr)
62# define BOOST_NO_CXX11_CONSTEXPR
63#endif
64
65#if !__has_feature(cxx_decltype)
66# define BOOST_NO_CXX11_DECLTYPE
67#endif
68
69#if !__has_feature(cxx_decltype_incomplete_return_types)
70# define BOOST_NO_CXX11_DECLTYPE_N3276
71#endif
72
73#if !__has_feature(cxx_defaulted_functions)
74# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
75#endif
76
77#if !__has_feature(cxx_deleted_functions)
78# define BOOST_NO_CXX11_DELETED_FUNCTIONS
79#endif
80
81#if !__has_feature(cxx_explicit_conversions)
82# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
83#endif
84
85#if !__has_feature(cxx_default_function_template_args)
86# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
87#endif
88
89#if !__has_feature(cxx_generalized_initializers)
90# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
91#endif
92
93#if !__has_feature(cxx_lambdas)
94# define BOOST_NO_CXX11_LAMBDAS
95#endif
96
97#if !__has_feature(cxx_local_type_template_args)
98# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
99#endif
100
101#if !__has_feature(cxx_noexcept)
102# define BOOST_NO_CXX11_NOEXCEPT
103#endif
104
105#if !__has_feature(cxx_nullptr)
106# define BOOST_NO_CXX11_NULLPTR
107#endif
108
109#if !__has_feature(cxx_range_for)
110# define BOOST_NO_CXX11_RANGE_BASED_FOR
111#endif
112
113#if !__has_feature(cxx_raw_string_literals)
114# define BOOST_NO_CXX11_RAW_LITERALS
115#endif
116
117#if !__has_feature(cxx_generalized_initializers)
118# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
119#endif
120
121#if !__has_feature(cxx_rvalue_references)
122# define BOOST_NO_CXX11_RVALUE_REFERENCES
123#endif
124
125#if !__has_feature(cxx_strong_enums)
126# define BOOST_NO_CXX11_SCOPED_ENUMS
127#endif
128
129#if !__has_feature(cxx_static_assert)
130# define BOOST_NO_CXX11_STATIC_ASSERT
131#endif
132
133#if !__has_feature(cxx_alias_templates)
134# define BOOST_NO_CXX11_TEMPLATE_ALIASES
135#endif
136
137#if !__has_feature(cxx_unicode_literals)
138# define BOOST_NO_CXX11_UNICODE_LITERALS
139#endif
140
141#if !__has_feature(cxx_variadic_templates)
142# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
143#endif
144
Jeff Thompsona28eed82013-08-22 16:21:10 -0700145#if !__has_feature(cxx_user_literals)
146# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
147#endif
148
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700149// Clang always supports variadic macros
150// Clang always supports extern templates
151
152#ifndef BOOST_COMPILER
153# define BOOST_COMPILER "Clang version " __clang_version__
154#endif
155
156// Macro used to identify the Clang compiler.
157#define BOOST_CLANG 1
158