X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Fmpl%2Fassert.hpp;h=33b82f3ffa11ab3a49cef1d93ac3f00b611d9d2d;hb=c48091f33a773732fa6c789927e5833e44108d9d;hp=29202ea3084c4c65414a1ea2fb9ff6c5fac616d5;hpb=9a2bf73e316d8850e9b58812e09feb1a832a8608;p=lyx.git diff --git a/boost/boost/mpl/assert.hpp b/boost/boost/mpl/assert.hpp index 29202ea308..33b82f3ffa 100644 --- a/boost/boost/mpl/assert.hpp +++ b/boost/boost/mpl/assert.hpp @@ -10,9 +10,9 @@ // // See http://www.boost.org/libs/mpl for documentation. -// $Source$ -// $Date: 2006-11-10 22:31:19 +0100 (Fri, 10 Nov 2006) $ -// $Revision: 35997 $ +// $Id: assert.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ #include #include @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -34,7 +35,7 @@ #include -#if BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, < 0x600) \ +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \ || (BOOST_MPL_CFG_GCC != 0) \ || BOOST_WORKAROUND(__IBMCPP__, <= 600) # define BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES @@ -42,7 +43,7 @@ #if BOOST_WORKAROUND(__MWERKS__, < 0x3202) \ || BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \ - || BOOST_WORKAROUND(__BORLANDC__, < 0x600) \ + || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) # define BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER #endif @@ -50,7 +51,7 @@ // agurt, 10/nov/06: use enums for Borland (which cannot cope with static constants) // and GCC (which issues "unused variable" warnings when static constants are used // at a function scope) -#if BOOST_WORKAROUND(__BORLANDC__, < 0x600) \ +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \ || (BOOST_MPL_CFG_GCC != 0) # define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) enum { expr } #else @@ -216,7 +217,7 @@ BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE #define BOOST_MPL_ASSERT(pred) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion_failed( \ boost::mpl::assert_arg( (void (*) pred)0, 1 ) \ ) \ @@ -229,7 +230,7 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) # define BOOST_MPL_ASSERT_NOT(pred) \ enum { \ - BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion::failed( \ boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \ ) \ @@ -240,7 +241,7 @@ enum { \ # define BOOST_MPL_ASSERT_NOT(pred) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion_failed( \ boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \ ) \ @@ -255,12 +256,12 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ # if !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER) // agurt, 9/nov/06: 'enum' below is a workaround for gcc 4.0.4/4.1.1 bugs #29522 and #29518 -# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ -enum { BOOST_PP_CAT(mpl_assert_rel_value,__LINE__) = (x rel y) }; \ +# define BOOST_MPL_ASSERT_RELATION_IMPL(counter, x, rel, y) \ +enum { BOOST_PP_CAT(mpl_assert_rel_value,counter) = (x rel y) }; \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ - boost::mpl::assertion_failed( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \ + boost::mpl::assertion_failed( \ (boost::mpl::failed ************ ( boost::mpl::assert_relation< \ boost::mpl::assert_::relations( sizeof( \ boost::mpl::assert_::arg rel boost::mpl::assert_::arg \ @@ -272,20 +273,20 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ ) \ /**/ # else -# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ +# define BOOST_MPL_ASSERT_RELATION_IMPL(counter, x, rel, y) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assert_rel,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assert_rel,counter) = sizeof( \ boost::mpl::assert_::arg rel boost::mpl::assert_::arg \ ) \ ); \ -BOOST_MPL_AUX_ASSERT_CONSTANT( bool, BOOST_PP_CAT(mpl_assert_rel_value,__LINE__) = (x rel y) ); \ +BOOST_MPL_AUX_ASSERT_CONSTANT( bool, BOOST_PP_CAT(mpl_assert_rel_value,counter) = (x rel y) ); \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ - boost::mpl::assertion_failed( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \ + boost::mpl::assertion_failed( \ boost::mpl::assert_rel_arg( boost::mpl::assert_relation< \ - boost::mpl::assert_::relations(BOOST_PP_CAT(mpl_assert_rel,__LINE__)) \ + boost::mpl::assert_::relations(BOOST_PP_CAT(mpl_assert_rel,counter)) \ , x \ , y \ >() ) \ @@ -295,13 +296,17 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ /**/ # endif +# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ +BOOST_MPL_ASSERT_RELATION_IMPL(BOOST_MPL_AUX_PP_COUNTER(), x, rel, y) \ +/**/ + #else // !BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES # if defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER) # define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion_failed<(x rel y)>( boost::mpl::assert_rel_arg( \ boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))() \ ) ) \ @@ -312,7 +317,7 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ # define BOOST_MPL_ASSERT_RELATION(x, rel, y) \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ boost::mpl::assertion_failed<(x rel y)>( (boost::mpl::failed ************ ( \ boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))::************))0 ) \ ) \ @@ -326,36 +331,40 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ // BOOST_MPL_ASSERT_MSG( (pred::value), USER_PROVIDED_MESSAGE, (types) ) #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) -# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \ +# define BOOST_MPL_ASSERT_MSG_IMPL( counter, c, msg, types_ ) \ struct msg; \ -typedef struct BOOST_PP_CAT(msg,__LINE__) : boost::mpl::assert_ \ +typedef struct BOOST_PP_CAT(msg,counter) : boost::mpl::assert_ \ { \ using boost::mpl::assert_::types; \ static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \ { return 0; } \ -} BOOST_PP_CAT(mpl_assert_arg,__LINE__); \ +} BOOST_PP_CAT(mpl_assert_arg,counter); \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ - boost::mpl::assertion<(c)>::failed( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \ + , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \ + boost::mpl::assertion<(c)>::failed( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \ ) \ ) \ /**/ #else -# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \ +# define BOOST_MPL_ASSERT_MSG_IMPL( counter, c, msg, types_ ) \ struct msg; \ -typedef struct BOOST_PP_CAT(msg,__LINE__) : boost::mpl::assert_ \ +typedef struct BOOST_PP_CAT(msg,counter) : boost::mpl::assert_ \ { \ static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \ { return 0; } \ -} BOOST_PP_CAT(mpl_assert_arg,__LINE__); \ +} BOOST_PP_CAT(mpl_assert_arg,counter); \ BOOST_MPL_AUX_ASSERT_CONSTANT( \ std::size_t \ - , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ - boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \ + , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \ + boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \ ) \ ) \ /**/ #endif +#define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \ +BOOST_MPL_ASSERT_MSG_IMPL( BOOST_MPL_AUX_PP_COUNTER(), c, msg, types_ ) \ +/**/ + #endif // BOOST_MPL_ASSERT_HPP_INCLUDED