Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:44:43

0001 // Copyright David Abrahams 2002.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef BOOST_CONFIG_WORKAROUND_HPP
0006 #define BOOST_CONFIG_WORKAROUND_HPP
0007 
0008 // Compiler/library version workaround macro
0009 //
0010 // Usage:
0011 //
0012 //   #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
0013 //      // workaround for eVC4 and VC6
0014 //      ... // workaround code here
0015 //   #endif
0016 //
0017 // When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the
0018 // first argument must be undefined or expand to a numeric
0019 // value. The above expands to:
0020 //
0021 //   (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300
0022 //
0023 // When used for workarounds that apply to the latest known version
0024 // and all earlier versions of a compiler, the following convention
0025 // should be observed:
0026 //
0027 //   #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301))
0028 //
0029 // The version number in this case corresponds to the last version in
0030 // which the workaround was known to have been required. When
0031 // BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro
0032 // BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates
0033 // the workaround for any version of the compiler. When
0034 // BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or
0035 // error will be issued if the compiler version exceeds the argument
0036 // to BOOST_TESTED_AT().  This can be used to locate workarounds which
0037 // may be obsoleted by newer versions.
0038 
0039 #ifndef BOOST_STRICT_CONFIG
0040 
0041 #include <boost/config.hpp>
0042 
0043 #ifndef __BORLANDC__
0044 #define __BORLANDC___WORKAROUND_GUARD 1
0045 #else
0046 #define __BORLANDC___WORKAROUND_GUARD 0
0047 #endif
0048 #ifndef __CODEGEARC__
0049 #define __CODEGEARC___WORKAROUND_GUARD 1
0050 #else
0051 #define __CODEGEARC___WORKAROUND_GUARD 0
0052 #endif
0053 #ifndef BOOST_BORLANDC
0054 #define BOOST_BORLANDC_WORKAROUND_GUARD 1
0055 #else
0056 #define BOOST_BORLANDC_WORKAROUND_GUARD 0
0057 #endif
0058 #ifndef BOOST_CODEGEARC
0059 #define BOOST_CODEGEARC_WORKAROUND_GUARD 1
0060 #else
0061 #define BOOST_CODEGEARC_WORKAROUND_GUARD 0
0062 #endif
0063 #ifndef BOOST_EMBTC
0064 #define BOOST_EMBTC_WORKAROUND_GUARD 1
0065 #else
0066 #define BOOST_EMBTC_WORKAROUND_GUARD 0
0067 #endif
0068 #ifndef _MSC_VER
0069 #define _MSC_VER_WORKAROUND_GUARD 1
0070 #else
0071 #define _MSC_VER_WORKAROUND_GUARD 0
0072 #endif
0073 #ifndef _MSC_FULL_VER
0074 #define _MSC_FULL_VER_WORKAROUND_GUARD 1
0075 #else
0076 #define _MSC_FULL_VER_WORKAROUND_GUARD 0
0077 #endif
0078 #ifndef BOOST_MSVC
0079 #define BOOST_MSVC_WORKAROUND_GUARD 1
0080 #else
0081 #define BOOST_MSVC_WORKAROUND_GUARD 0
0082 #endif
0083 #ifndef BOOST_MSVC_FULL_VER
0084 #define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 1
0085 #else
0086 #define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 0
0087 #endif
0088 #ifndef __GNUC__
0089 #define __GNUC___WORKAROUND_GUARD 1
0090 #else
0091 #define __GNUC___WORKAROUND_GUARD 0
0092 #endif
0093 #ifndef __GNUC_MINOR__
0094 #define __GNUC_MINOR___WORKAROUND_GUARD 1
0095 #else
0096 #define __GNUC_MINOR___WORKAROUND_GUARD 0
0097 #endif
0098 #ifndef __GNUC_PATCHLEVEL__
0099 #define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 1
0100 #else
0101 #define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 0
0102 #endif
0103 #ifndef BOOST_GCC
0104 #define BOOST_GCC_WORKAROUND_GUARD 1
0105 #define BOOST_GCC_VERSION_WORKAROUND_GUARD 1
0106 #else
0107 #define BOOST_GCC_WORKAROUND_GUARD 0
0108 #define BOOST_GCC_VERSION_WORKAROUND_GUARD 0
0109 #endif
0110 #ifndef BOOST_XLCPP_ZOS
0111 #define BOOST_XLCPP_ZOS_WORKAROUND_GUARD 1
0112 #else
0113 #define BOOST_XLCPP_ZOS_WORKAROUND_GUARD 0
0114 #endif
0115 #ifndef __IBMCPP__
0116 #define __IBMCPP___WORKAROUND_GUARD 1
0117 #else
0118 #define __IBMCPP___WORKAROUND_GUARD 0
0119 #endif
0120 #ifndef __SUNPRO_CC
0121 #define __SUNPRO_CC_WORKAROUND_GUARD 1
0122 #else
0123 #define __SUNPRO_CC_WORKAROUND_GUARD 0
0124 #endif
0125 #ifndef __DECCXX_VER
0126 #define __DECCXX_VER_WORKAROUND_GUARD 1
0127 #else
0128 #define __DECCXX_VER_WORKAROUND_GUARD 0
0129 #endif
0130 #ifndef __MWERKS__
0131 #define __MWERKS___WORKAROUND_GUARD 1
0132 #else
0133 #define __MWERKS___WORKAROUND_GUARD 0
0134 #endif
0135 #ifndef __EDG__
0136 #define __EDG___WORKAROUND_GUARD 1
0137 #else
0138 #define __EDG___WORKAROUND_GUARD 0
0139 #endif
0140 #ifndef __EDG_VERSION__
0141 #define __EDG_VERSION___WORKAROUND_GUARD 1
0142 #else
0143 #define __EDG_VERSION___WORKAROUND_GUARD 0
0144 #endif
0145 #ifndef __HP_aCC
0146 #define __HP_aCC_WORKAROUND_GUARD 1
0147 #else
0148 #define __HP_aCC_WORKAROUND_GUARD 0
0149 #endif
0150 #ifndef __hpxstd98
0151 #define __hpxstd98_WORKAROUND_GUARD 1
0152 #else
0153 #define __hpxstd98_WORKAROUND_GUARD 0
0154 #endif
0155 #ifndef _CRAYC
0156 #define _CRAYC_WORKAROUND_GUARD 1
0157 #else
0158 #define _CRAYC_WORKAROUND_GUARD 0
0159 #endif
0160 #ifndef __DMC__
0161 #define __DMC___WORKAROUND_GUARD 1
0162 #else
0163 #define __DMC___WORKAROUND_GUARD 0
0164 #endif
0165 #ifndef MPW_CPLUS
0166 #define MPW_CPLUS_WORKAROUND_GUARD 1
0167 #else
0168 #define MPW_CPLUS_WORKAROUND_GUARD 0
0169 #endif
0170 #ifndef __COMO__
0171 #define __COMO___WORKAROUND_GUARD 1
0172 #else
0173 #define __COMO___WORKAROUND_GUARD 0
0174 #endif
0175 #ifndef __COMO_VERSION__
0176 #define __COMO_VERSION___WORKAROUND_GUARD 1
0177 #else
0178 #define __COMO_VERSION___WORKAROUND_GUARD 0
0179 #endif
0180 #ifndef __INTEL_COMPILER
0181 #define __INTEL_COMPILER_WORKAROUND_GUARD 1
0182 #else
0183 #define __INTEL_COMPILER_WORKAROUND_GUARD 0
0184 #endif
0185 #ifndef __ICL
0186 #define __ICL_WORKAROUND_GUARD 1
0187 #else
0188 #define __ICL_WORKAROUND_GUARD 0
0189 #endif
0190 #ifndef _COMPILER_VERSION
0191 #define _COMPILER_VERSION_WORKAROUND_GUARD 1
0192 #else
0193 #define _COMPILER_VERSION_WORKAROUND_GUARD 0
0194 #endif
0195 #ifndef __clang_major__
0196 #define __clang_major___WORKAROUND_GUARD 1
0197 #else
0198 #define __clang_major___WORKAROUND_GUARD 0
0199 #endif
0200 
0201 #ifndef _RWSTD_VER
0202 #define _RWSTD_VER_WORKAROUND_GUARD 1
0203 #else
0204 #define _RWSTD_VER_WORKAROUND_GUARD 0
0205 #endif
0206 #ifndef BOOST_RWSTD_VER
0207 #define BOOST_RWSTD_VER_WORKAROUND_GUARD 1
0208 #else
0209 #define BOOST_RWSTD_VER_WORKAROUND_GUARD 0
0210 #endif
0211 #ifndef __GLIBCPP__
0212 #define __GLIBCPP___WORKAROUND_GUARD 1
0213 #else
0214 #define __GLIBCPP___WORKAROUND_GUARD 0
0215 #endif
0216 #ifndef _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
0217 #define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 1
0218 #else
0219 #define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 0
0220 #endif
0221 #ifndef __SGI_STL_PORT
0222 #define __SGI_STL_PORT_WORKAROUND_GUARD 1
0223 #else
0224 #define __SGI_STL_PORT_WORKAROUND_GUARD 0
0225 #endif
0226 #ifndef _STLPORT_VERSION
0227 #define _STLPORT_VERSION_WORKAROUND_GUARD 1
0228 #else
0229 #define _STLPORT_VERSION_WORKAROUND_GUARD 0
0230 #endif
0231 #ifndef __LIBCOMO_VERSION__
0232 #define __LIBCOMO_VERSION___WORKAROUND_GUARD 1
0233 #else
0234 #define __LIBCOMO_VERSION___WORKAROUND_GUARD 0
0235 #endif
0236 #ifndef _CPPLIB_VER
0237 #define _CPPLIB_VER_WORKAROUND_GUARD 1
0238 #else
0239 #define _CPPLIB_VER_WORKAROUND_GUARD 0
0240 #endif
0241 
0242 #ifndef BOOST_INTEL_CXX_VERSION
0243 #define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 1
0244 #else
0245 #define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 0
0246 #endif
0247 #ifndef BOOST_INTEL_WIN
0248 #define BOOST_INTEL_WIN_WORKAROUND_GUARD 1
0249 #else
0250 #define BOOST_INTEL_WIN_WORKAROUND_GUARD 0
0251 #endif
0252 #ifndef BOOST_DINKUMWARE_STDLIB
0253 #define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 1
0254 #else
0255 #define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 0
0256 #endif
0257 #ifndef BOOST_INTEL
0258 #define BOOST_INTEL_WORKAROUND_GUARD 1
0259 #else
0260 #define BOOST_INTEL_WORKAROUND_GUARD 0
0261 #endif
0262 #ifndef BOOST_CLANG_VERSION
0263 #define BOOST_CLANG_VERSION_WORKAROUND_GUARD 1
0264 #else
0265 #define BOOST_CLANG_VERSION_WORKAROUND_GUARD 0
0266 #endif
0267 
0268 // Always define to zero, if it's used it'll be defined my MPL:
0269 #define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0
0270 
0271 #define BOOST_WORKAROUND(symbol, test)                \
0272        ((symbol ## _WORKAROUND_GUARD + 0 == 0) &&     \
0273        (symbol != 0) && (1 % (( (symbol test) ) + 1)))
0274 //                              ^ ^           ^ ^
0275 // The extra level of parenthesis nesting above, along with the
0276 // BOOST_OPEN_PAREN indirection below, is required to satisfy the
0277 // broken preprocessor in MWCW 8.3 and earlier.
0278 //
0279 // The basic mechanism works as follows:
0280 //   (symbol test) + 1        =>   if (symbol test) then 2 else 1
0281 //   1 % ((symbol test) + 1)  =>   if (symbol test) then 1 else 0
0282 //
0283 // The complication with % is for cooperation with BOOST_TESTED_AT().
0284 // When "test" is BOOST_TESTED_AT(x) and
0285 // BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined,
0286 //
0287 //   symbol test              =>   if (symbol <= x) then 1 else -1
0288 //   (symbol test) + 1        =>   if (symbol <= x) then 2 else 0
0289 //   1 % ((symbol test) + 1)  =>   if (symbol <= x) then 1 else divide-by-zero
0290 //
0291 
0292 #ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS
0293 #  define BOOST_OPEN_PAREN (
0294 #  define BOOST_TESTED_AT(value)  > value) ?(-1): BOOST_OPEN_PAREN 1
0295 #else
0296 #  define BOOST_TESTED_AT(value) != ((value)-(value))
0297 #endif
0298 
0299 #else
0300 
0301 #define BOOST_WORKAROUND(symbol, test) 0
0302 
0303 #endif
0304 
0305 #endif // BOOST_CONFIG_WORKAROUND_HPP