blob: d8ab35c15c8b6cc8e5a319c9175f41c01c642976 [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
Jeff Thompson3d613fd2013-10-15 15:39:04 -070011#if !__has_feature(cxx_exceptions) && !defined(NDNBOOST_NO_EXCEPTIONS)
12# define NDNBOOST_NO_EXCEPTIONS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070013#endif
14
Jeff Thompson3d613fd2013-10-15 15:39:04 -070015#if !__has_feature(cxx_rtti) && !defined(NDNBOOST_NO_RTTI)
16# define NDNBOOST_NO_RTTI
Jeff Thompsonf7d49942013-08-01 16:47:40 -070017#endif
18
Jeff Thompson3d613fd2013-10-15 15:39:04 -070019#if !__has_feature(cxx_rtti) && !defined(NDNBOOST_NO_TYPEID)
20# define NDNBOOST_NO_TYPEID
Jeff Thompsonf7d49942013-08-01 16:47:40 -070021#endif
22
Jeff Thompsona28eed82013-08-22 16:21:10 -070023#if defined(__int64) && !defined(__GNUC__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070024# define NDNBOOST_HAS_MS_INT64
Jeff Thompsonf7d49942013-08-01 16:47:40 -070025#endif
26
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027#define NDNBOOST_HAS_NRVO
Jeff Thompsonf7d49942013-08-01 16:47:40 -070028
29// Clang supports "long long" in all compilation modes.
Jeff Thompson3d613fd2013-10-15 15:39:04 -070030#define NDNBOOST_HAS_LONG_LONG
Jeff Thompsonf7d49942013-08-01 16:47:40 -070031
32//
33// Dynamic shared object (DSO) and dynamic-link library (DLL) support
34//
35#if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070036# define NDNBOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
37# define NDNBOOST_SYMBOL_IMPORT
38# define NDNBOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
Jeff Thompsonf7d49942013-08-01 16:47:40 -070039#endif
40
Jeff Thompsona28eed82013-08-22 16:21:10 -070041//
Jeff Thompson3d613fd2013-10-15 15:39:04 -070042// The NDNBOOST_FALLTHROUGH macro can be used to annotate implicit fall-through
Jeff Thompsona28eed82013-08-22 16:21:10 -070043// between switch labels.
44//
45#if __cplusplus >= 201103L && defined(__has_warning)
46# if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
Jeff Thompson3d613fd2013-10-15 15:39:04 -070047# define NDNBOOST_FALLTHROUGH [[clang::fallthrough]]
Jeff Thompsona28eed82013-08-22 16:21:10 -070048# endif
49#endif
50
Jeff Thompsonf7d49942013-08-01 16:47:40 -070051#if !__has_feature(cxx_auto_type)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070052# define NDNBOOST_NO_CXX11_AUTO_DECLARATIONS
53# define NDNBOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070054#endif
55
56#if !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070057# define NDNBOOST_NO_CXX11_CHAR16_T
58# define NDNBOOST_NO_CXX11_CHAR32_T
Jeff Thompsonf7d49942013-08-01 16:47:40 -070059#endif
60
61#if !__has_feature(cxx_constexpr)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070062# define NDNBOOST_NO_CXX11_CONSTEXPR
Jeff Thompsonf7d49942013-08-01 16:47:40 -070063#endif
64
65#if !__has_feature(cxx_decltype)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070066# define NDNBOOST_NO_CXX11_DECLTYPE
Jeff Thompsonf7d49942013-08-01 16:47:40 -070067#endif
68
69#if !__has_feature(cxx_decltype_incomplete_return_types)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070070# define NDNBOOST_NO_CXX11_DECLTYPE_N3276
Jeff Thompsonf7d49942013-08-01 16:47:40 -070071#endif
72
73#if !__has_feature(cxx_defaulted_functions)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070074# define NDNBOOST_NO_CXX11_DEFAULTED_FUNCTIONS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070075#endif
76
77#if !__has_feature(cxx_deleted_functions)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070078# define NDNBOOST_NO_CXX11_DELETED_FUNCTIONS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070079#endif
80
81#if !__has_feature(cxx_explicit_conversions)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070082# define NDNBOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070083#endif
84
85#if !__has_feature(cxx_default_function_template_args)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070086# define NDNBOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070087#endif
88
89#if !__has_feature(cxx_generalized_initializers)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070090# define NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST
Jeff Thompsonf7d49942013-08-01 16:47:40 -070091#endif
92
93#if !__has_feature(cxx_lambdas)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070094# define NDNBOOST_NO_CXX11_LAMBDAS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070095#endif
96
97#if !__has_feature(cxx_local_type_template_args)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070098# define NDNBOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070099#endif
100
101#if !__has_feature(cxx_noexcept)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700102# define NDNBOOST_NO_CXX11_NOEXCEPT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700103#endif
104
105#if !__has_feature(cxx_nullptr)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700106# define NDNBOOST_NO_CXX11_NULLPTR
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700107#endif
108
109#if !__has_feature(cxx_range_for)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700110# define NDNBOOST_NO_CXX11_RANGE_BASED_FOR
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700111#endif
112
113#if !__has_feature(cxx_raw_string_literals)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700114# define NDNBOOST_NO_CXX11_RAW_LITERALS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700115#endif
116
117#if !__has_feature(cxx_generalized_initializers)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700118# define NDNBOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700119#endif
120
121#if !__has_feature(cxx_rvalue_references)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700122# define NDNBOOST_NO_CXX11_RVALUE_REFERENCES
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700123#endif
124
125#if !__has_feature(cxx_strong_enums)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700126# define NDNBOOST_NO_CXX11_SCOPED_ENUMS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700127#endif
128
129#if !__has_feature(cxx_static_assert)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700130# define NDNBOOST_NO_CXX11_STATIC_ASSERT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700131#endif
132
133#if !__has_feature(cxx_alias_templates)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700134# define NDNBOOST_NO_CXX11_TEMPLATE_ALIASES
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700135#endif
136
137#if !__has_feature(cxx_unicode_literals)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700138# define NDNBOOST_NO_CXX11_UNICODE_LITERALS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700139#endif
140
141#if !__has_feature(cxx_variadic_templates)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700142# define NDNBOOST_NO_CXX11_VARIADIC_TEMPLATES
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700143#endif
144
Jeff Thompsona28eed82013-08-22 16:21:10 -0700145#if !__has_feature(cxx_user_literals)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700146# define NDNBOOST_NO_CXX11_USER_DEFINED_LITERALS
Jeff Thompsona28eed82013-08-22 16:21:10 -0700147#endif
148
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700149// Clang always supports variadic macros
150// Clang always supports extern templates
151
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700152#ifndef NDNBOOST_COMPILER
153# define NDNBOOST_COMPILER "Clang version " __clang_version__
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700154#endif
155
156// Macro used to identify the Clang compiler.
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700157#define NDNBOOST_CLANG 1
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700158