From 20a6ef4d408473b03e7313e5ab30406d79f8d949 Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Wed, 19 May 2004 14:09:47 +0000 Subject: [PATCH] workaround a conflict with macros [SVN r22870] --- include/boost/mpl/and.hpp | 18 ++++++++++++++++++ include/boost/mpl/or.hpp | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/include/boost/mpl/and.hpp b/include/boost/mpl/and.hpp index a2cced8..3e8008a 100644 --- a/include/boost/mpl/and.hpp +++ b/include/boost/mpl/and.hpp @@ -28,9 +28,27 @@ # include "boost/mpl/aux_/void_spec.hpp" # include "boost/mpl/aux_/lambda_support.hpp" +// agurt, 19/may/04: workaround a conflict with header's +// 'or' and 'and' macros, see http://tinyurl.com/3et69; 'defined(or)' +// has to be checked in a separate condition, otherwise GCC complains +// about 'or' being an alternative token +#if defined(_MSC_VER) +#if defined(and) +# pragma push_macro("and") +# undef and +# define and(x) +#endif +#endif + # define BOOST_MPL_PREPROCESSED_HEADER and.hpp # include "boost/mpl/aux_/include_preprocessed.hpp" +#if defined(_MSC_VER) +#if defined(and) +# pragma pop_macro("and") +#endif +#endif + #else # define AUX_LOGICAL_OP_NAME and_ diff --git a/include/boost/mpl/or.hpp b/include/boost/mpl/or.hpp index 297088e..55bb7c5 100644 --- a/include/boost/mpl/or.hpp +++ b/include/boost/mpl/or.hpp @@ -28,9 +28,27 @@ # include "boost/mpl/aux_/void_spec.hpp" # include "boost/mpl/aux_/lambda_support.hpp" +// agurt, 19/may/04: workaround a conflict with header's +// 'or' and 'and' macros, see http://tinyurl.com/3et69; 'defined(or)' +// has to be checked in a separate condition, otherwise GCC complains +// about 'or' being an alternative token +#if defined(_MSC_VER) +#if defined(or) +# pragma push_macro("or") +# undef or +# define or(x) +#endif +#endif + # define BOOST_MPL_PREPROCESSED_HEADER or.hpp # include "boost/mpl/aux_/include_preprocessed.hpp" +#if defined(_MSC_VER) +#if defined(or) +# pragma pop_macro("or") +#endif +#endif + #else # define AUX_LOGICAL_OP_NAME or_