File indexing completed on 2025-07-05 08:36:32
0001 #ifndef BOOST_LEAF_CONFIG_HPP_INCLUDED
0002 #define BOOST_LEAF_CONFIG_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_LEAF_ASSERT
0016 # include <cassert>
0017 # define BOOST_LEAF_ASSERT assert
0018 #endif
0019
0020
0021
0022 #ifdef BOOST_LEAF_DIAGNOSTICS
0023 # warning BOOST_LEAF_DIAGNOSTICS has been renamed to BOOST_LEAF_CFG_DIAGNOSTICS.
0024 # define BOOST_LEAF_CFG_DIAGNOSTICS BOOST_LEAF_DIAGNOSTICS
0025 #endif
0026
0027
0028
0029 #ifdef BOOST_LEAF_TLS_FREERTOS
0030
0031 # ifndef BOOST_LEAF_EMBEDDED
0032 # define BOOST_LEAF_EMBEDDED
0033 # endif
0034
0035 #endif
0036
0037
0038
0039 #ifdef BOOST_LEAF_EMBEDDED
0040
0041 # ifndef BOOST_LEAF_CFG_DIAGNOSTICS
0042 # define BOOST_LEAF_CFG_DIAGNOSTICS 0
0043 # endif
0044
0045 # ifndef BOOST_LEAF_CFG_STD_SYSTEM_ERROR
0046 # define BOOST_LEAF_CFG_STD_SYSTEM_ERROR 0
0047 # endif
0048
0049 # ifndef BOOST_LEAF_CFG_STD_STRING
0050 # define BOOST_LEAF_CFG_STD_STRING 0
0051 # endif
0052
0053 # ifndef BOOST_LEAF_CFG_CAPTURE
0054 # define BOOST_LEAF_CFG_CAPTURE 0
0055 # endif
0056
0057 #endif
0058
0059
0060
0061 #ifndef BOOST_LEAF_CFG_DIAGNOSTICS
0062 # define BOOST_LEAF_CFG_DIAGNOSTICS 1
0063 #endif
0064
0065 #ifndef BOOST_LEAF_CFG_STD_SYSTEM_ERROR
0066 # define BOOST_LEAF_CFG_STD_SYSTEM_ERROR 1
0067 #endif
0068
0069 #ifndef BOOST_LEAF_CFG_STD_STRING
0070 # define BOOST_LEAF_CFG_STD_STRING 1
0071 #endif
0072
0073 #ifndef BOOST_LEAF_CFG_CAPTURE
0074 # define BOOST_LEAF_CFG_CAPTURE 1
0075 #endif
0076
0077 #ifndef BOOST_LEAF_CFG_WIN32
0078 # define BOOST_LEAF_CFG_WIN32 0
0079 #endif
0080
0081 #ifndef BOOST_LEAF_CFG_GNUC_STMTEXPR
0082 # ifdef __GNUC__
0083 # define BOOST_LEAF_CFG_GNUC_STMTEXPR 1
0084 # else
0085 # define BOOST_LEAF_CFG_GNUC_STMTEXPR 0
0086 # endif
0087 #endif
0088
0089 #if BOOST_LEAF_CFG_DIAGNOSTICS!=0 && BOOST_LEAF_CFG_DIAGNOSTICS!=1
0090 # error BOOST_LEAF_CFG_DIAGNOSTICS must be 0 or 1.
0091 #endif
0092
0093 #if BOOST_LEAF_CFG_STD_SYSTEM_ERROR!=0 && BOOST_LEAF_CFG_STD_SYSTEM_ERROR!=1
0094 # error BOOST_LEAF_CFG_STD_SYSTEM_ERROR must be 0 or 1.
0095 #endif
0096
0097 #if BOOST_LEAF_CFG_STD_STRING!=0 && BOOST_LEAF_CFG_STD_STRING!=1
0098 # error BOOST_LEAF_CFG_STD_STRING must be 0 or 1.
0099 #endif
0100
0101 #if BOOST_LEAF_CFG_CAPTURE!=0 && BOOST_LEAF_CFG_CAPTURE!=1
0102 # error BOOST_LEAF_CFG_CAPTURE must be 0 or 1.
0103 #endif
0104
0105 #if BOOST_LEAF_CFG_WIN32!=0 && BOOST_LEAF_CFG_WIN32!=1
0106 # error BOOST_LEAF_CFG_WIN32 must be 0 or 1.
0107 #endif
0108
0109 #if BOOST_LEAF_CFG_GNUC_STMTEXPR!=0 && BOOST_LEAF_CFG_GNUC_STMTEXPR!=1
0110 # error BOOST_LEAF_CFG_GNUC_STMTEXPR must be 0 or 1.
0111 #endif
0112
0113 #if BOOST_LEAF_CFG_DIAGNOSTICS && !BOOST_LEAF_CFG_STD_STRING
0114 # error BOOST_LEAF_CFG_DIAGNOSTICS requires BOOST_LEAF_CFG_STD_STRING, which has been disabled.
0115 #endif
0116
0117 #if BOOST_LEAF_CFG_STD_SYSTEM_ERROR && !BOOST_LEAF_CFG_STD_STRING
0118 # error BOOST_LEAF_CFG_STD_SYSTEM_ERROR requires BOOST_LEAF_CFG_STD_STRING, which has been disabled.
0119 #endif
0120
0121
0122
0123
0124 #ifndef BOOST_LEAF_NO_EXCEPTIONS
0125
0126 # if defined(__clang__) && !defined(__ibmxl__)
0127
0128
0129 # if !__has_feature(cxx_exceptions)
0130 # define BOOST_LEAF_NO_EXCEPTIONS
0131 # endif
0132
0133 # elif defined(__DMC__)
0134
0135
0136 # if !defined(_CPPUNWIND)
0137 # define BOOST_LEAF_NO_EXCEPTIONS
0138 # endif
0139
0140 # elif defined(__GNUC__) && !defined(__ibmxl__)
0141
0142
0143 # if !defined(__EXCEPTIONS)
0144 # define BOOST_LEAF_NO_EXCEPTIONS
0145 # endif
0146
0147 # elif defined(__KCC)
0148
0149
0150 # if !defined(_EXCEPTIONS)
0151 # define BOOST_LEAF_NO_EXCEPTIONS
0152 # endif
0153
0154 # elif defined(__CODEGEARC__)
0155
0156
0157 # if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS)
0158 # define BOOST_LEAF_NO_EXCEPTIONS
0159 # endif
0160
0161 # elif defined(__BORLANDC__)
0162
0163
0164 # if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS)
0165 # define BOOST_LEAF_NO_EXCEPTIONS
0166 # endif
0167
0168 # elif defined(__MWERKS__)
0169
0170
0171 # if !__option(exceptions)
0172 # define BOOST_LEAF_NO_EXCEPTIONS
0173 # endif
0174
0175 # elif defined(__IBMCPP__) && defined(__COMPILER_VER__) && defined(__MVS__)
0176
0177
0178 # if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS)
0179 # define BOOST_LEAF_NO_EXCEPTIONS
0180 # endif
0181
0182 # elif defined(__ibmxl__)
0183
0184
0185 # if !__has_feature(cxx_exceptions)
0186 # define BOOST_LEAF_NO_EXCEPTIONS
0187 # endif
0188
0189 # elif defined(_MSC_VER)
0190
0191
0192
0193
0194
0195 # if !_CPPUNWIND
0196 # define BOOST_LEAF_NO_EXCEPTIONS
0197 # endif
0198 # endif
0199
0200 #endif
0201
0202
0203
0204 #ifdef _MSC_VER
0205 # define BOOST_LEAF_ALWAYS_INLINE __forceinline
0206 #else
0207 # define BOOST_LEAF_ALWAYS_INLINE __attribute__((always_inline)) inline
0208 #endif
0209
0210
0211
0212 #if defined(__has_attribute) && defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x5130)
0213 # if __has_attribute(nodiscard)
0214 # define BOOST_LEAF_ATTRIBUTE_NODISCARD [[nodiscard]]
0215 # endif
0216 #elif defined(__has_cpp_attribute)
0217
0218 # if __has_cpp_attribute(nodiscard) && __cplusplus >= 201703L
0219 # define BOOST_LEAF_ATTRIBUTE_NODISCARD [[nodiscard]]
0220 # endif
0221 #endif
0222 #ifndef BOOST_LEAF_ATTRIBUTE_NODISCARD
0223 # define BOOST_LEAF_ATTRIBUTE_NODISCARD
0224 #endif
0225
0226
0227
0228 #ifndef BOOST_LEAF_CONSTEXPR
0229 # if __cplusplus > 201402L
0230 # define BOOST_LEAF_CONSTEXPR constexpr
0231 # else
0232 # define BOOST_LEAF_CONSTEXPR
0233 # endif
0234 #endif
0235
0236
0237
0238 #ifndef BOOST_LEAF_DEPRECATED
0239 # if __cplusplus > 201402L
0240 # define BOOST_LEAF_DEPRECATED(msg) [[deprecated(msg)]]
0241 # else
0242 # define BOOST_LEAF_DEPRECATED(msg)
0243 # endif
0244 #endif
0245
0246
0247
0248 #ifndef BOOST_LEAF_NO_EXCEPTIONS
0249 # include <exception>
0250 # if (defined(__cpp_lib_uncaught_exceptions) && __cpp_lib_uncaught_exceptions >= 201411L) || (defined(_MSC_VER) && _MSC_VER >= 1900)
0251 # define BOOST_LEAF_STD_UNCAUGHT_EXCEPTIONS 1
0252 # else
0253 # define BOOST_LEAF_STD_UNCAUGHT_EXCEPTIONS 0
0254 # endif
0255 #endif
0256
0257
0258
0259 #ifdef __GNUC__
0260 # define BOOST_LEAF_SYMBOL_VISIBLE [[gnu::visibility("default")]]
0261 #else
0262 # define BOOST_LEAF_SYMBOL_VISIBLE
0263 #endif
0264
0265
0266
0267 #if defined(__GNUC__) && !(defined(__clang__) || defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) && (__GNUC__ * 100 + __GNUC_MINOR__) < 409
0268 # ifndef BOOST_LEAF_NO_CXX11_REF_QUALIFIERS
0269 # define BOOST_LEAF_NO_CXX11_REF_QUALIFIERS
0270 # endif
0271 #endif
0272
0273
0274
0275
0276 #include <boost/leaf/config/tls.hpp>
0277
0278
0279
0280 #endif