os/ossrv/ossrv_pub/boost_apis/boost/detail/workaround.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/detail/workaround.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,74 @@
     1.4 +// Copyright David Abrahams 2002.
     1.5 +// Distributed under the Boost Software License, Version 1.0. (See
     1.6 +// accompanying file LICENSE_1_0.txt or copy at
     1.7 +// http://www.boost.org/LICENSE_1_0.txt)
     1.8 +#ifndef WORKAROUND_DWA2002126_HPP
     1.9 +# define WORKAROUND_DWA2002126_HPP
    1.10 +
    1.11 +// Compiler/library version workaround macro
    1.12 +//
    1.13 +// Usage:
    1.14 +//
    1.15 +//     #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
    1.16 +//        // workaround for eVC4 and VC6
    1.17 +//        ... // workaround code here
    1.18 +//     #endif
    1.19 +//
    1.20 +// When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the
    1.21 +// first argument must be undefined or expand to a numeric
    1.22 +// value. The above expands to:
    1.23 +//
    1.24 +//     (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300
    1.25 +//
    1.26 +// When used for workarounds that apply to the latest known version 
    1.27 +// and all earlier versions of a compiler, the following convention 
    1.28 +// should be observed:
    1.29 +//
    1.30 +//     #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301))
    1.31 +//
    1.32 +// The version number in this case corresponds to the last version in
    1.33 +// which the workaround was known to have been required. When
    1.34 +// BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro
    1.35 +// BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates
    1.36 +// the workaround for any version of the compiler. When
    1.37 +// BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or
    1.38 +// error will be issued if the compiler version exceeds the argument
    1.39 +// to BOOST_TESTED_AT().  This can be used to locate workarounds which
    1.40 +// may be obsoleted by newer versions.
    1.41 +
    1.42 +# ifndef BOOST_STRICT_CONFIG
    1.43 +
    1.44 +#  define BOOST_WORKAROUND(symbol, test)                \
    1.45 +        ((symbol != 0) && (1 % (( (symbol test) ) + 1)))
    1.46 +//                              ^ ^           ^ ^
    1.47 +// The extra level of parenthesis nesting above, along with the
    1.48 +// BOOST_OPEN_PAREN indirection below, is required to satisfy the
    1.49 +// broken preprocessor in MWCW 8.3 and earlier.
    1.50 +//
    1.51 +// The basic mechanism works as follows:
    1.52 +//      (symbol test) + 1        =>   if (symbol test) then 2 else 1
    1.53 +//      1 % ((symbol test) + 1)  =>   if (symbol test) then 1 else 0
    1.54 +//
    1.55 +// The complication with % is for cooperation with BOOST_TESTED_AT().
    1.56 +// When "test" is BOOST_TESTED_AT(x) and
    1.57 +// BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined,
    1.58 +//
    1.59 +//      symbol test              =>   if (symbol <= x) then 1 else -1
    1.60 +//      (symbol test) + 1        =>   if (symbol <= x) then 2 else 0
    1.61 +//      1 % ((symbol test) + 1)  =>   if (symbol <= x) then 1 else divide-by-zero
    1.62 +//
    1.63 +
    1.64 +#  ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS
    1.65 +#   define BOOST_OPEN_PAREN (
    1.66 +#   define BOOST_TESTED_AT(value)  > value) ?(-1): BOOST_OPEN_PAREN 1
    1.67 +#  else
    1.68 +#   define BOOST_TESTED_AT(value) != ((value)-(value))
    1.69 +#  endif
    1.70 +
    1.71 +# else
    1.72 +
    1.73 +#  define BOOST_WORKAROUND(symbol, test) 0
    1.74 +
    1.75 +# endif 
    1.76 +
    1.77 +#endif // WORKAROUND_DWA2002126_HPP