workaround.hpp
Go to the documentation of this file.
00001 // Copyright David Abrahams 2002.
00002 // Distributed under the Boost Software License, Version 1.0. (See
00003 // accompanying file LICENSE_1_0.txt or copy at
00004 // http://www.boost.org/LICENSE_1_0.txt)
00005 #ifndef WORKAROUND_DWA2002126_HPP
00006 # define WORKAROUND_DWA2002126_HPP
00007 
00008 // Compiler/library version workaround macro
00009 //
00010 // Usage:
00011 //
00012 //     #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
00013 //        // workaround for eVC4 and VC6
00014 //        ... // workaround code here
00015 //     #endif
00016 //
00017 // When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the
00018 // first argument must be undefined or expand to a numeric
00019 // value. The above expands to:
00020 //
00021 //     (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300
00022 //
00023 // When used for workarounds that apply to the latest known version 
00024 // and all earlier versions of a compiler, the following convention 
00025 // should be observed:
00026 //
00027 //     #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301))
00028 //
00029 // The version number in this case corresponds to the last version in
00030 // which the workaround was known to have been required. When
00031 // BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro
00032 // BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates
00033 // the workaround for any version of the compiler. When
00034 // BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or
00035 // error will be issued if the compiler version exceeds the argument
00036 // to BOOST_TESTED_AT().  This can be used to locate workarounds which
00037 // may be obsoleted by newer versions.
00038 
00039 # ifndef BOOST_STRICT_CONFIG
00040 
00041 #include <boost/config.hpp>
00042 
00043 #ifndef __BORLANDC__
00044 #define __BORLANDC___WORKAROUND_GUARD 1
00045 #else
00046 #define __BORLANDC___WORKAROUND_GUARD 0
00047 #endif
00048 #ifndef __CODEGEARC__
00049 #define __CODEGEARC___WORKAROUND_GUARD 1
00050 #else
00051 #define __CODEGEARC___WORKAROUND_GUARD 0
00052 #endif
00053 #ifndef _MSC_VER
00054 #define _MSC_VER_WORKAROUND_GUARD 1
00055 #else
00056 #define _MSC_VER_WORKAROUND_GUARD 0
00057 #endif
00058 #ifndef _MSC_FULL_VER
00059 #define _MSC_FULL_VER_WORKAROUND_GUARD 1
00060 #else
00061 #define _MSC_FULL_VER_WORKAROUND_GUARD 0
00062 #endif
00063 #ifndef BOOST_MSVC
00064 #define BOOST_MSVC_WORKAROUND_GUARD 1
00065 #else
00066 #define BOOST_MSVC_WORKAROUND_GUARD 0
00067 #endif
00068 #ifndef __GNUC__
00069 #define __GNUC___WORKAROUND_GUARD 1
00070 #else
00071 #define __GNUC___WORKAROUND_GUARD 0
00072 #endif
00073 #ifndef __GNUC_MINOR__
00074 #define __GNUC_MINOR___WORKAROUND_GUARD 1
00075 #else
00076 #define __GNUC_MINOR___WORKAROUND_GUARD 0
00077 #endif
00078 #ifndef __GNUC_PATCHLEVEL__
00079 #define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 1
00080 #else
00081 #define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 0
00082 #endif
00083 #ifndef __IBMCPP__
00084 #define __IBMCPP___WORKAROUND_GUARD 1
00085 #else
00086 #define __IBMCPP___WORKAROUND_GUARD 0
00087 #endif
00088 #ifndef __SUNPRO_CC
00089 #define __SUNPRO_CC_WORKAROUND_GUARD 1
00090 #else
00091 #define __SUNPRO_CC_WORKAROUND_GUARD 0
00092 #endif
00093 #ifndef __DECCXX_VER
00094 #define __DECCXX_VER_WORKAROUND_GUARD 1
00095 #else
00096 #define __DECCXX_VER_WORKAROUND_GUARD 0
00097 #endif
00098 #ifndef __MWERKS__
00099 #define __MWERKS___WORKAROUND_GUARD 1
00100 #else
00101 #define __MWERKS___WORKAROUND_GUARD 0
00102 #endif
00103 #ifndef __EDG__
00104 #define __EDG___WORKAROUND_GUARD 1
00105 #else
00106 #define __EDG___WORKAROUND_GUARD 0
00107 #endif
00108 #ifndef __EDG_VERSION__
00109 #define __EDG_VERSION___WORKAROUND_GUARD 1
00110 #else
00111 #define __EDG_VERSION___WORKAROUND_GUARD 0
00112 #endif
00113 #ifndef __HP_aCC
00114 #define __HP_aCC_WORKAROUND_GUARD 1
00115 #else
00116 #define __HP_aCC_WORKAROUND_GUARD 0
00117 #endif
00118 #ifndef __hpxstd98
00119 #define __hpxstd98_WORKAROUND_GUARD 1
00120 #else
00121 #define __hpxstd98_WORKAROUND_GUARD 0
00122 #endif
00123 #ifndef _CRAYC
00124 #define _CRAYC_WORKAROUND_GUARD 1
00125 #else
00126 #define _CRAYC_WORKAROUND_GUARD 0
00127 #endif
00128 #ifndef __DMC__
00129 #define __DMC___WORKAROUND_GUARD 1
00130 #else
00131 #define __DMC___WORKAROUND_GUARD 0
00132 #endif
00133 #ifndef MPW_CPLUS
00134 #define MPW_CPLUS_WORKAROUND_GUARD 1
00135 #else
00136 #define MPW_CPLUS_WORKAROUND_GUARD 0
00137 #endif
00138 #ifndef __COMO__
00139 #define __COMO___WORKAROUND_GUARD 1
00140 #else
00141 #define __COMO___WORKAROUND_GUARD 0
00142 #endif
00143 #ifndef __COMO_VERSION__
00144 #define __COMO_VERSION___WORKAROUND_GUARD 1
00145 #else
00146 #define __COMO_VERSION___WORKAROUND_GUARD 0
00147 #endif
00148 #ifndef __INTEL_COMPILER
00149 #define __INTEL_COMPILER_WORKAROUND_GUARD 1
00150 #else
00151 #define __INTEL_COMPILER_WORKAROUND_GUARD 0
00152 #endif
00153 #ifndef __ICL
00154 #define __ICL_WORKAROUND_GUARD 1
00155 #else
00156 #define __ICL_WORKAROUND_GUARD 0
00157 #endif
00158 #ifndef _COMPILER_VERSION
00159 #define _COMPILER_VERSION_WORKAROUND_GUARD 1
00160 #else
00161 #define _COMPILER_VERSION_WORKAROUND_GUARD 0
00162 #endif
00163 
00164 #ifndef _RWSTD_VER
00165 #define _RWSTD_VER_WORKAROUND_GUARD 1
00166 #else
00167 #define _RWSTD_VER_WORKAROUND_GUARD 0
00168 #endif
00169 #ifndef BOOST_RWSTD_VER
00170 #define BOOST_RWSTD_VER_WORKAROUND_GUARD 1
00171 #else
00172 #define BOOST_RWSTD_VER_WORKAROUND_GUARD 0
00173 #endif
00174 #ifndef __GLIBCPP__
00175 #define __GLIBCPP___WORKAROUND_GUARD 1
00176 #else
00177 #define __GLIBCPP___WORKAROUND_GUARD 0
00178 #endif
00179 #ifndef _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
00180 #define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 1
00181 #else
00182 #define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 0
00183 #endif
00184 #ifndef __SGI_STL_PORT
00185 #define __SGI_STL_PORT_WORKAROUND_GUARD 1
00186 #else
00187 #define __SGI_STL_PORT_WORKAROUND_GUARD 0
00188 #endif
00189 #ifndef _STLPORT_VERSION
00190 #define _STLPORT_VERSION_WORKAROUND_GUARD 1
00191 #else
00192 #define _STLPORT_VERSION_WORKAROUND_GUARD 0
00193 #endif
00194 #ifndef __LIBCOMO_VERSION__
00195 #define __LIBCOMO_VERSION___WORKAROUND_GUARD 1
00196 #else
00197 #define __LIBCOMO_VERSION___WORKAROUND_GUARD 0
00198 #endif
00199 #ifndef _CPPLIB_VER
00200 #define _CPPLIB_VER_WORKAROUND_GUARD 1
00201 #else
00202 #define _CPPLIB_VER_WORKAROUND_GUARD 0
00203 #endif
00204 
00205 #ifndef BOOST_INTEL_CXX_VERSION
00206 #define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 1
00207 #else
00208 #define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 0
00209 #endif
00210 #ifndef BOOST_INTEL_WIN
00211 #define BOOST_INTEL_WIN_WORKAROUND_GUARD 1
00212 #else
00213 #define BOOST_INTEL_WIN_WORKAROUND_GUARD 0
00214 #endif
00215 #ifndef BOOST_DINKUMWARE_STDLIB
00216 #define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 1
00217 #else
00218 #define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 0
00219 #endif
00220 #ifndef BOOST_INTEL
00221 #define BOOST_INTEL_WORKAROUND_GUARD 1
00222 #else
00223 #define BOOST_INTEL_WORKAROUND_GUARD 0
00224 #endif
00225 // Always define to zero, if it's used it'll be defined my MPL:
00226 #define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0
00227 
00228 #  define BOOST_WORKAROUND(symbol, test)                \
00229          ((symbol ## _WORKAROUND_GUARD + 0 == 0) &&     \
00230          (symbol != 0) && (1 % (( (symbol test) ) + 1)))
00231 //                              ^ ^           ^ ^
00232 // The extra level of parenthesis nesting above, along with the
00233 // BOOST_OPEN_PAREN indirection below, is required to satisfy the
00234 // broken preprocessor in MWCW 8.3 and earlier.
00235 //
00236 // The basic mechanism works as follows:
00237 //      (symbol test) + 1        =>   if (symbol test) then 2 else 1
00238 //      1 % ((symbol test) + 1)  =>   if (symbol test) then 1 else 0
00239 //
00240 // The complication with % is for cooperation with BOOST_TESTED_AT().
00241 // When "test" is BOOST_TESTED_AT(x) and
00242 // BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined,
00243 //
00244 //      symbol test              =>   if (symbol <= x) then 1 else -1
00245 //      (symbol test) + 1        =>   if (symbol <= x) then 2 else 0
00246 //      1 % ((symbol test) + 1)  =>   if (symbol <= x) then 1 else divide-by-zero
00247 //
00248 
00249 #  ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS
00250 #   define BOOST_OPEN_PAREN (
00251 #   define BOOST_TESTED_AT(value)  > value) ?(-1): BOOST_OPEN_PAREN 1
00252 #  else
00253 #   define BOOST_TESTED_AT(value) != ((value)-(value))
00254 #  endif
00255 
00256 # else
00257 
00258 #  define BOOST_WORKAROUND(symbol, test) 0
00259 
00260 # endif 
00261 
00262 #endif // WORKAROUND_DWA2002126_HPP


appl
Author(s): petercai
autogenerated on Tue Jan 7 2014 11:02:29