1 #ifndef BOOST_MP11_DETAIL_CONFIG_HPP_INCLUDED
2 #define BOOST_MP11_DETAIL_CONFIG_HPP_INCLUDED
4 // Copyright 2016, 2018, 2019 Peter Dimov.
6 // Distributed under the Boost Software License, Version 1.0.
8 // See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt
11 // BOOST_MP11_WORKAROUND
13 #if defined( BOOST_STRICT_CONFIG ) || defined( BOOST_MP11_NO_WORKAROUNDS )
15 # define BOOST_MP11_WORKAROUND( symbol, test ) 0
19 # define BOOST_MP11_WORKAROUND( symbol, test ) ((symbol) != 0 && ((symbol) test))
25 #define BOOST_MP11_CUDA 0
26 #define BOOST_MP11_CLANG 0
27 #define BOOST_MP11_INTEL 0
28 #define BOOST_MP11_GCC 0
29 #define BOOST_MP11_MSVC 0
31 #define BOOST_MP11_CONSTEXPR constexpr
33 #if defined( __CUDACC__ )
37 # undef BOOST_MP11_CUDA
38 # define BOOST_MP11_CUDA (__CUDACC_VER_MAJOR__ * 1000000 + __CUDACC_VER_MINOR__ * 10000 + __CUDACC_VER_BUILD__)
40 // CUDA (8.0) has no constexpr support in msvc mode:
41 # if defined(_MSC_VER) && (BOOST_MP11_CUDA < 9000000)
43 # define BOOST_MP11_NO_CONSTEXPR
45 # undef BOOST_MP11_CONSTEXPR
46 # define BOOST_MP11_CONSTEXPR
52 #if defined(__clang__)
56 # undef BOOST_MP11_CLANG
57 # define BOOST_MP11_CLANG (__clang_major__ * 100 + __clang_minor__)
59 # if defined(__has_cpp_attribute)
60 # if __has_cpp_attribute(fallthrough) && __cplusplus >= 201406L // Clang 3.9+ in c++1z mode
61 # define BOOST_MP11_HAS_FOLD_EXPRESSIONS
65 #if BOOST_MP11_CLANG < 400 && __cplusplus >= 201402L \
66 && defined( __GLIBCXX__ ) && !__has_include(<shared_mutex>)
68 // Clang pre-4 in C++14 mode, libstdc++ pre-4.9, ::gets is not defined,
69 // but Clang tries to import it into std
71 extern "C" char *gets (char *__s);
74 #elif defined(__INTEL_COMPILER)
78 # undef BOOST_MP11_INTEL
79 # define BOOST_MP11_INTEL __INTEL_COMPILER
81 #elif defined(__GNUC__)
85 # undef BOOST_MP11_GCC
86 # define BOOST_MP11_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
88 #elif defined(_MSC_VER)
92 # undef BOOST_MP11_MSVC
93 # define BOOST_MP11_MSVC _MSC_VER
95 # if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
96 # define BOOST_MP11_NO_CONSTEXPR
99 #if _MSC_FULL_VER < 190024210 // 2015u3
100 # undef BOOST_MP11_CONSTEXPR
101 # define BOOST_MP11_CONSTEXPR
106 // BOOST_MP11_HAS_CXX14_CONSTEXPR
108 #if !defined(BOOST_MP11_NO_CONSTEXPR) && defined(__cpp_constexpr) && __cpp_constexpr >= 201304
109 # define BOOST_MP11_HAS_CXX14_CONSTEXPR
112 // BOOST_MP11_HAS_FOLD_EXPRESSIONS
114 #if !defined(BOOST_MP11_HAS_FOLD_EXPRESSIONS) && defined(__cpp_fold_expressions) && __cpp_fold_expressions >= 201603
115 # define BOOST_MP11_HAS_FOLD_EXPRESSIONS
118 // BOOST_MP11_HAS_TYPE_PACK_ELEMENT
120 #if defined(__has_builtin)
121 # if __has_builtin(__type_pack_element)
122 # define BOOST_MP11_HAS_TYPE_PACK_ELEMENT
126 // BOOST_MP11_DEPRECATED(msg)
128 #if BOOST_MP11_WORKAROUND( BOOST_MP11_CLANG, < 304 )
129 # define BOOST_MP11_DEPRECATED(msg)
130 #elif defined(__GNUC__) || defined(__clang__)
131 # define BOOST_MP11_DEPRECATED(msg) __attribute__((deprecated(msg)))
132 #elif defined(_MSC_VER) && _MSC_VER >= 1900
133 # define BOOST_MP11_DEPRECATED(msg) [[deprecated(msg)]]
135 # define BOOST_MP11_DEPRECATED(msg)
138 #endif // #ifndef BOOST_MP11_DETAIL_CONFIG_HPP_INCLUDED