Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 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 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 11 | #if !__has_feature(cxx_exceptions) && !defined(NDNBOOST_NO_EXCEPTIONS) |
| 12 | # define NDNBOOST_NO_EXCEPTIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 13 | #endif |
| 14 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 15 | #if !__has_feature(cxx_rtti) && !defined(NDNBOOST_NO_RTTI) |
| 16 | # define NDNBOOST_NO_RTTI |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 17 | #endif |
| 18 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 19 | #if !__has_feature(cxx_rtti) && !defined(NDNBOOST_NO_TYPEID) |
| 20 | # define NDNBOOST_NO_TYPEID |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 21 | #endif |
| 22 | |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 23 | #if defined(__int64) && !defined(__GNUC__) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 24 | # define NDNBOOST_HAS_MS_INT64 |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 25 | #endif |
| 26 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 27 | #define NDNBOOST_HAS_NRVO |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 28 | |
| 29 | // Clang supports "long long" in all compilation modes. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 30 | #define NDNBOOST_HAS_LONG_LONG |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 31 | |
| 32 | // |
| 33 | // Dynamic shared object (DSO) and dynamic-link library (DLL) support |
| 34 | // |
| 35 | #if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 36 | # define NDNBOOST_SYMBOL_EXPORT __attribute__((__visibility__("default"))) |
| 37 | # define NDNBOOST_SYMBOL_IMPORT |
| 38 | # define NDNBOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default"))) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 39 | #endif |
| 40 | |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 41 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 42 | // The NDNBOOST_FALLTHROUGH macro can be used to annotate implicit fall-through |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 43 | // between switch labels. |
| 44 | // |
| 45 | #if __cplusplus >= 201103L && defined(__has_warning) |
| 46 | # if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 47 | # define NDNBOOST_FALLTHROUGH [[clang::fallthrough]] |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 48 | # endif |
| 49 | #endif |
| 50 | |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 51 | #if !__has_feature(cxx_auto_type) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 52 | # define NDNBOOST_NO_CXX11_AUTO_DECLARATIONS |
| 53 | # define NDNBOOST_NO_CXX11_AUTO_MULTIDECLARATIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 54 | #endif |
| 55 | |
| 56 | #if !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 57 | # define NDNBOOST_NO_CXX11_CHAR16_T |
| 58 | # define NDNBOOST_NO_CXX11_CHAR32_T |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 59 | #endif |
| 60 | |
| 61 | #if !__has_feature(cxx_constexpr) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 62 | # define NDNBOOST_NO_CXX11_CONSTEXPR |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 63 | #endif |
| 64 | |
| 65 | #if !__has_feature(cxx_decltype) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 66 | # define NDNBOOST_NO_CXX11_DECLTYPE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 67 | #endif |
| 68 | |
| 69 | #if !__has_feature(cxx_decltype_incomplete_return_types) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 70 | # define NDNBOOST_NO_CXX11_DECLTYPE_N3276 |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 71 | #endif |
| 72 | |
| 73 | #if !__has_feature(cxx_defaulted_functions) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 74 | # define NDNBOOST_NO_CXX11_DEFAULTED_FUNCTIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 75 | #endif |
| 76 | |
| 77 | #if !__has_feature(cxx_deleted_functions) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 78 | # define NDNBOOST_NO_CXX11_DELETED_FUNCTIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 79 | #endif |
| 80 | |
| 81 | #if !__has_feature(cxx_explicit_conversions) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 82 | # define NDNBOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 83 | #endif |
| 84 | |
| 85 | #if !__has_feature(cxx_default_function_template_args) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 86 | # define NDNBOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 87 | #endif |
| 88 | |
| 89 | #if !__has_feature(cxx_generalized_initializers) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 90 | # define NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 91 | #endif |
| 92 | |
| 93 | #if !__has_feature(cxx_lambdas) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 94 | # define NDNBOOST_NO_CXX11_LAMBDAS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 95 | #endif |
| 96 | |
| 97 | #if !__has_feature(cxx_local_type_template_args) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 98 | # define NDNBOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 99 | #endif |
| 100 | |
| 101 | #if !__has_feature(cxx_noexcept) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 102 | # define NDNBOOST_NO_CXX11_NOEXCEPT |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 103 | #endif |
| 104 | |
| 105 | #if !__has_feature(cxx_nullptr) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 106 | # define NDNBOOST_NO_CXX11_NULLPTR |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 107 | #endif |
| 108 | |
| 109 | #if !__has_feature(cxx_range_for) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 110 | # define NDNBOOST_NO_CXX11_RANGE_BASED_FOR |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 111 | #endif |
| 112 | |
| 113 | #if !__has_feature(cxx_raw_string_literals) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 114 | # define NDNBOOST_NO_CXX11_RAW_LITERALS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 115 | #endif |
| 116 | |
| 117 | #if !__has_feature(cxx_generalized_initializers) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 118 | # define NDNBOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 119 | #endif |
| 120 | |
| 121 | #if !__has_feature(cxx_rvalue_references) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 122 | # define NDNBOOST_NO_CXX11_RVALUE_REFERENCES |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 123 | #endif |
| 124 | |
| 125 | #if !__has_feature(cxx_strong_enums) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 126 | # define NDNBOOST_NO_CXX11_SCOPED_ENUMS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 127 | #endif |
| 128 | |
| 129 | #if !__has_feature(cxx_static_assert) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 130 | # define NDNBOOST_NO_CXX11_STATIC_ASSERT |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 131 | #endif |
| 132 | |
| 133 | #if !__has_feature(cxx_alias_templates) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 134 | # define NDNBOOST_NO_CXX11_TEMPLATE_ALIASES |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 135 | #endif |
| 136 | |
| 137 | #if !__has_feature(cxx_unicode_literals) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 138 | # define NDNBOOST_NO_CXX11_UNICODE_LITERALS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 139 | #endif |
| 140 | |
| 141 | #if !__has_feature(cxx_variadic_templates) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 142 | # define NDNBOOST_NO_CXX11_VARIADIC_TEMPLATES |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 143 | #endif |
| 144 | |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 145 | #if !__has_feature(cxx_user_literals) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 146 | # define NDNBOOST_NO_CXX11_USER_DEFINED_LITERALS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 147 | #endif |
| 148 | |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 149 | // Clang always supports variadic macros |
| 150 | // Clang always supports extern templates |
| 151 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 152 | #ifndef NDNBOOST_COMPILER |
| 153 | # define NDNBOOST_COMPILER "Clang version " __clang_version__ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 154 | #endif |
| 155 | |
| 156 | // Macro used to identify the Clang compiler. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 157 | #define NDNBOOST_CLANG 1 |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 158 | |