epoc32/include/stdapis/boost/detail/workaround.hpp
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/boost/detail/workaround.hpp	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/boost/detail/workaround.hpp	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,19 +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 -#ifndef BOOST_MPL_AUX_CONFIG_WORKAROUND_HPP_INCLUDED
    1.12 -#define BOOST_MPL_AUX_CONFIG_WORKAROUND_HPP_INCLUDED
    1.13 +// Compiler/library version workaround macro
    1.14 +//
    1.15 +// Usage:
    1.16 +//
    1.17 +//     #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
    1.18 +//        // workaround for eVC4 and VC6
    1.19 +//        ... // workaround code here
    1.20 +//     #endif
    1.21 +//
    1.22 +// When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the
    1.23 +// first argument must be undefined or expand to a numeric
    1.24 +// value. The above expands to:
    1.25 +//
    1.26 +//     (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300
    1.27 +//
    1.28 +// When used for workarounds that apply to the latest known version 
    1.29 +// and all earlier versions of a compiler, the following convention 
    1.30 +// should be observed:
    1.31 +//
    1.32 +//     #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301))
    1.33 +//
    1.34 +// The version number in this case corresponds to the last version in
    1.35 +// which the workaround was known to have been required. When
    1.36 +// BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro
    1.37 +// BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates
    1.38 +// the workaround for any version of the compiler. When
    1.39 +// BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or
    1.40 +// error will be issued if the compiler version exceeds the argument
    1.41 +// to BOOST_TESTED_AT().  This can be used to locate workarounds which
    1.42 +// may be obsoleted by newer versions.
    1.43  
    1.44 -// Copyright Aleksey Gurtovoy 2002-2004
    1.45 +# ifndef BOOST_STRICT_CONFIG
    1.46 +
    1.47 +#  define BOOST_WORKAROUND(symbol, test)                \
    1.48 +        ((symbol != 0) && (1 % (( (symbol test) ) + 1)))
    1.49 +//                              ^ ^           ^ ^
    1.50 +// The extra level of parenthesis nesting above, along with the
    1.51 +// BOOST_OPEN_PAREN indirection below, is required to satisfy the
    1.52 +// broken preprocessor in MWCW 8.3 and earlier.
    1.53  //
    1.54 -// Distributed under the Boost Software License, Version 1.0. 
    1.55 -// (See accompanying file LICENSE_1_0.txt or copy at 
    1.56 -// http://www.boost.org/LICENSE_1_0.txt)
    1.57 +// The basic mechanism works as follows:
    1.58 +//      (symbol test) + 1        =>   if (symbol test) then 2 else 1
    1.59 +//      1 % ((symbol test) + 1)  =>   if (symbol test) then 1 else 0
    1.60  //
    1.61 -// See http://www.boost.org/libs/mpl for documentation.
    1.62 +// The complication with % is for cooperation with BOOST_TESTED_AT().
    1.63 +// When "test" is BOOST_TESTED_AT(x) and
    1.64 +// BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined,
    1.65 +//
    1.66 +//      symbol test              =>   if (symbol <= x) then 1 else -1
    1.67 +//      (symbol test) + 1        =>   if (symbol <= x) then 2 else 0
    1.68 +//      1 % ((symbol test) + 1)  =>   if (symbol <= x) then 1 else divide-by-zero
    1.69 +//
    1.70  
    1.71 -// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/workaround.hpp,v $
    1.72 -// $Date: 2004/09/02 15:40:45 $
    1.73 -// $Revision: 1.3 $
    1.74 +#  ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS
    1.75 +#   define BOOST_OPEN_PAREN (
    1.76 +#   define BOOST_TESTED_AT(value)  > value) ?(-1): BOOST_OPEN_PAREN 1
    1.77 +#  else
    1.78 +#   define BOOST_TESTED_AT(value) != ((value)-(value))
    1.79 +#  endif
    1.80  
    1.81 -#include <boost/detail/workaround.hpp>
    1.82 +# else
    1.83  
    1.84 -#endif // BOOST_MPL_AUX_CONFIG_WORKAROUND_HPP_INCLUDED
    1.85 +#  define BOOST_WORKAROUND(symbol, test) 0
    1.86 +
    1.87 +# endif 
    1.88 +
    1.89 +#endif // WORKAROUND_DWA2002126_HPP