Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:04:33

0001 // (C) Copyright Douglas Gregor 2010
0002 //
0003 //  Use, modification and distribution are subject to the
0004 //  Boost Software License, Version 1.0. (See accompanying file
0005 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  See http://www.boost.org for most recent version.
0008 
0009 // Clang compiler setup.
0010 
0011 #define BOOST_HAS_PRAGMA_ONCE
0012 
0013 // Detecting `-fms-extension` compiler flag assuming that _MSC_VER defined when that flag is used.
0014 #if defined (_MSC_VER) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))
0015 #   define BOOST_HAS_PRAGMA_DETECT_MISMATCH
0016 #endif
0017 
0018 // When compiling with clang before __has_extension was defined,
0019 // even if one writes 'defined(__has_extension) && __has_extension(xxx)',
0020 // clang reports a compiler error. So the only workaround found is:
0021 
0022 #ifndef __has_extension
0023 #define __has_extension __has_feature
0024 #endif
0025 
0026 #ifndef __has_attribute
0027 #define __has_attribute(x) 0
0028 #endif
0029 
0030 #ifndef __has_cpp_attribute
0031 #define __has_cpp_attribute(x) 0
0032 #endif
0033 
0034 #if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
0035 #  define BOOST_NO_EXCEPTIONS
0036 #endif
0037 
0038 #if !__has_feature(cxx_rtti) && !defined(BOOST_NO_RTTI)
0039 #  define BOOST_NO_RTTI
0040 #endif
0041 
0042 #if !__has_feature(cxx_rtti) && !defined(BOOST_NO_TYPEID)
0043 #  define BOOST_NO_TYPEID
0044 #endif
0045 
0046 #if !__has_feature(cxx_thread_local)
0047 #  define BOOST_NO_CXX11_THREAD_LOCAL
0048 #endif
0049 
0050 #ifdef __is_identifier
0051 #if !__is_identifier(__int64) && !defined(__GNUC__)
0052 #  define BOOST_HAS_MS_INT64
0053 #endif
0054 #endif
0055 
0056 #if __has_include(<stdint.h>)
0057 #  define BOOST_HAS_STDINT_H
0058 #endif
0059 
0060 #if (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC)
0061 #if (__clang_major__ >= 4) && defined(__has_include)
0062 #if __has_include(<quadmath.h>)
0063 #  define BOOST_HAS_FLOAT128
0064 #endif
0065 #endif
0066 #endif
0067 
0068 
0069 #define BOOST_HAS_NRVO
0070 
0071 // Branch prediction hints
0072 #if !defined (__c2__) && defined(__has_builtin)
0073 #if __has_builtin(__builtin_expect)
0074 #define BOOST_LIKELY(x) __builtin_expect(x, 1)
0075 #define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
0076 #endif
0077 #endif
0078 
0079 // Clang supports "long long" in all compilation modes.
0080 #define BOOST_HAS_LONG_LONG
0081 
0082 //
0083 // We disable this if the compiler is really nvcc with C++03 as it
0084 // doesn't actually support __int128 as of CUDA_VERSION=7500
0085 // even though it defines __SIZEOF_INT128__.
0086 // See https://svn.boost.org/trac/boost/ticket/10418
0087 //     https://svn.boost.org/trac/boost/ticket/11852
0088 // Only re-enable this for nvcc if you're absolutely sure
0089 // of the circumstances under which it's supported.
0090 // Similarly __SIZEOF_INT128__ is defined when targetting msvc
0091 // compatibility even though the required support functions are absent.
0092 //
0093 #if defined(__CUDACC__)
0094 #  if defined(BOOST_GCC_CXX11)
0095 #    define BOOST_NVCC_CXX11
0096 #  else
0097 #    define BOOST_NVCC_CXX03
0098 #  endif
0099 #endif
0100 
0101 #if defined(__SIZEOF_INT128__) && !defined(BOOST_NVCC_CXX03) && !defined(_MSC_VER)
0102 #  define BOOST_HAS_INT128
0103 #endif
0104 
0105 
0106 //
0107 // Dynamic shared object (DSO) and dynamic-link library (DLL) support
0108 //
0109 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
0110 #  define BOOST_HAS_DECLSPEC
0111 #  define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__))
0112 #  define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__))
0113 #else
0114 #  define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
0115 #  define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
0116 #  define BOOST_SYMBOL_IMPORT
0117 #endif
0118 
0119 //
0120 // The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through
0121 // between switch labels.
0122 //
0123 #if __cplusplus >= 201103L && defined(__has_warning)
0124 #  if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
0125 #    define BOOST_FALLTHROUGH [[clang::fallthrough]]
0126 #  endif
0127 #endif
0128 
0129 #if !__has_feature(cxx_auto_type)
0130 #  define BOOST_NO_CXX11_AUTO_DECLARATIONS
0131 #  define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
0132 #endif
0133 
0134 //
0135 // Currently clang on Windows using VC++ RTL does not support C++11's char16_t or char32_t
0136 //
0137 #if (defined(_MSC_VER) && (_MSC_VER < 1900)) || !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
0138 #  define BOOST_NO_CXX11_CHAR16_T
0139 #  define BOOST_NO_CXX11_CHAR32_T
0140 #endif
0141 
0142 #if defined(_MSC_VER) && (_MSC_VER >= 1800) && !defined(__GNUC__)
0143 #define BOOST_HAS_EXPM1
0144 #define BOOST_HAS_LOG1P
0145 #endif
0146 
0147 #if !__has_feature(cxx_constexpr)
0148 #  define BOOST_NO_CXX11_CONSTEXPR
0149 #endif
0150 
0151 #if !__has_feature(cxx_decltype)
0152 #  define BOOST_NO_CXX11_DECLTYPE
0153 #endif
0154 
0155 #if !__has_feature(cxx_decltype_incomplete_return_types)
0156 #  define BOOST_NO_CXX11_DECLTYPE_N3276
0157 #endif
0158 
0159 #if !__has_feature(cxx_defaulted_functions)
0160 #  define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
0161 #endif
0162 
0163 #if !__has_feature(cxx_deleted_functions)
0164 #  define BOOST_NO_CXX11_DELETED_FUNCTIONS
0165 #endif
0166 
0167 #if !__has_feature(cxx_explicit_conversions)
0168 #  define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
0169 #endif
0170 
0171 #if !__has_feature(cxx_default_function_template_args)
0172 #  define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
0173 #endif
0174 
0175 #if !__has_feature(cxx_generalized_initializers)
0176 #  define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
0177 #endif
0178 
0179 #if !__has_feature(cxx_lambdas)
0180 #  define BOOST_NO_CXX11_LAMBDAS
0181 #endif
0182 
0183 #if !__has_feature(cxx_local_type_template_args)
0184 #  define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
0185 #endif
0186 
0187 #if !__has_feature(cxx_noexcept)
0188 #  define BOOST_NO_CXX11_NOEXCEPT
0189 #endif
0190 
0191 #if !__has_feature(cxx_nullptr)
0192 #  define BOOST_NO_CXX11_NULLPTR
0193 #endif
0194 
0195 #if !__has_feature(cxx_range_for)
0196 #  define BOOST_NO_CXX11_RANGE_BASED_FOR
0197 #endif
0198 
0199 #if !__has_feature(cxx_raw_string_literals)
0200 #  define BOOST_NO_CXX11_RAW_LITERALS
0201 #endif
0202 
0203 #if !__has_feature(cxx_reference_qualified_functions)
0204 #  define BOOST_NO_CXX11_REF_QUALIFIERS
0205 #endif
0206 
0207 #if !__has_feature(cxx_generalized_initializers)
0208 #  define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
0209 #endif
0210 
0211 #if !__has_feature(cxx_rvalue_references)
0212 #  define BOOST_NO_CXX11_RVALUE_REFERENCES
0213 #endif
0214 
0215 #if !__has_feature(cxx_strong_enums)
0216 #  define BOOST_NO_CXX11_SCOPED_ENUMS
0217 #endif
0218 
0219 #if !__has_feature(cxx_static_assert)
0220 #  define BOOST_NO_CXX11_STATIC_ASSERT
0221 #endif
0222 
0223 #if !__has_feature(cxx_alias_templates)
0224 #  define BOOST_NO_CXX11_TEMPLATE_ALIASES
0225 #endif
0226 
0227 #if !__has_feature(cxx_unicode_literals)
0228 #  define BOOST_NO_CXX11_UNICODE_LITERALS
0229 #endif
0230 
0231 #if !__has_feature(cxx_variadic_templates)
0232 #  define BOOST_NO_CXX11_VARIADIC_TEMPLATES
0233 #endif
0234 
0235 #if !__has_feature(cxx_user_literals)
0236 #  define BOOST_NO_CXX11_USER_DEFINED_LITERALS
0237 #endif
0238 
0239 #if !__has_feature(cxx_alignas)
0240 #  define BOOST_NO_CXX11_ALIGNAS
0241 #endif
0242 
0243 #if !__has_feature(cxx_alignof)
0244 #  define BOOST_NO_CXX11_ALIGNOF
0245 #endif
0246 
0247 #if !__has_feature(cxx_trailing_return)
0248 #  define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
0249 #endif
0250 
0251 #if !__has_feature(cxx_inline_namespaces)
0252 #  define BOOST_NO_CXX11_INLINE_NAMESPACES
0253 #endif
0254 
0255 #if !__has_feature(cxx_override_control)
0256 #  define BOOST_NO_CXX11_FINAL
0257 #  define BOOST_NO_CXX11_OVERRIDE
0258 #endif
0259 
0260 #if !__has_feature(cxx_unrestricted_unions)
0261 #  define BOOST_NO_CXX11_UNRESTRICTED_UNION
0262 #endif
0263 
0264 #if !(__has_feature(__cxx_binary_literals__) || __has_extension(__cxx_binary_literals__))
0265 #  define BOOST_NO_CXX14_BINARY_LITERALS
0266 #endif
0267 
0268 #if !__has_feature(__cxx_decltype_auto__)
0269 #  define BOOST_NO_CXX14_DECLTYPE_AUTO
0270 #endif
0271 
0272 #if !__has_feature(__cxx_aggregate_nsdmi__)
0273 #  define BOOST_NO_CXX14_AGGREGATE_NSDMI
0274 #endif
0275 
0276 #if !__has_feature(__cxx_init_captures__)
0277 #  define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
0278 #endif
0279 
0280 #if !__has_feature(__cxx_generic_lambdas__)
0281 #  define BOOST_NO_CXX14_GENERIC_LAMBDAS
0282 #endif
0283 
0284 // clang < 3.5 has a defect with dependent type, like following.
0285 //
0286 //  template <class T>
0287 //  constexpr typename enable_if<pred<T> >::type foo(T &)
0288 //  { } // error: no return statement in constexpr function
0289 //
0290 // This issue also affects C++11 mode, but C++11 constexpr requires return stmt.
0291 // Therefore we don't care such case.
0292 //
0293 // Note that we can't check Clang version directly as the numbering system changes depending who's
0294 // creating the Clang release (see https://github.com/boostorg/config/pull/39#issuecomment-59927873)
0295 // so instead verify that we have a feature that was introduced at the same time as working C++14
0296 // constexpr (generic lambda's in this case):
0297 //
0298 #if !__has_feature(__cxx_generic_lambdas__) || !__has_feature(__cxx_relaxed_constexpr__)
0299 #  define BOOST_NO_CXX14_CONSTEXPR
0300 #endif
0301 
0302 #if !__has_feature(__cxx_return_type_deduction__)
0303 #  define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
0304 #endif
0305 
0306 #if !__has_feature(__cxx_variable_templates__)
0307 #  define BOOST_NO_CXX14_VARIABLE_TEMPLATES
0308 #endif
0309 
0310 #if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606)
0311 #  define BOOST_NO_CXX17_STRUCTURED_BINDINGS
0312 #endif
0313 
0314 #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606)
0315 #  define BOOST_NO_CXX17_IF_CONSTEXPR
0316 #endif
0317 
0318 // Clang 3.9+ in c++1z
0319 #if !__has_cpp_attribute(fallthrough) || __cplusplus < 201406L
0320 #  define BOOST_NO_CXX17_INLINE_VARIABLES
0321 #  define BOOST_NO_CXX17_FOLD_EXPRESSIONS
0322 #endif
0323 
0324 #if __cplusplus < 201103L
0325 #define BOOST_NO_CXX11_SFINAE_EXPR
0326 #endif
0327 
0328 #if __cplusplus < 201400
0329 // All versions with __cplusplus above this value seem to support this:
0330 #  define BOOST_NO_CXX14_DIGIT_SEPARATORS
0331 #endif
0332 
0333 // Unreachable code markup
0334 #if defined(__has_builtin)
0335 #if __has_builtin(__builtin_unreachable)
0336 #define BOOST_UNREACHABLE_RETURN(x) __builtin_unreachable();
0337 #endif
0338 #endif
0339 
0340 // Deprecated symbol markup
0341 #if __has_attribute(deprecated)
0342 #define BOOST_DEPRECATED(msg) __attribute__((deprecated(msg)))
0343 #endif
0344 
0345 #if (__clang_major__ == 3) && (__clang_minor__ == 0)
0346 // Apparently a clang bug:
0347 #  define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
0348 #endif
0349 
0350 // Clang has supported the 'unused' attribute since the first release.
0351 #define BOOST_ATTRIBUTE_UNUSED __attribute__((__unused__))
0352 
0353 // Type aliasing hint.
0354 #if __has_attribute(__may_alias__)
0355 #  define BOOST_MAY_ALIAS __attribute__((__may_alias__))
0356 #endif
0357 
0358 #ifndef BOOST_COMPILER
0359 #  define BOOST_COMPILER "Clang version " __clang_version__
0360 #endif
0361 
0362 // Macro used to identify the Clang compiler.
0363 #define BOOST_CLANG 1
0364 
0365 // BOOST_CLANG_VERSION
0366 #include <boost/config/compiler/clang_version.hpp>