From 4c6d309384c68cb8750443f939d41db62467cbf9 Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Fri, 8 Feb 2002 16:54:43 +0000 Subject: [PATCH] MWCW workaround [SVN r12760] --- include/boost/preprocessor/tuple/reverse.hpp | 9 ++++++++- include/boost/preprocessor/tuple/to_list.hpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/boost/preprocessor/tuple/reverse.hpp b/include/boost/preprocessor/tuple/reverse.hpp index 4262963..b2e14f6 100644 --- a/include/boost/preprocessor/tuple/reverse.hpp +++ b/include/boost/preprocessor/tuple/reverse.hpp @@ -26,7 +26,14 @@ #define BOOST_PP_TUPLE_REVERSE(N,T) BOOST_PP_TUPLE_REVERSE_DELAY(N,T) #ifndef DOXYGEN_SHOULD_SKIP_THIS -#define BOOST_PP_TUPLE_REVERSE_DELAY(N,T) BOOST_PP_TUPLE##N##_REVERSE T +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +/* This is a workaround for a CodeWarrior PP bug. Strictly speaking + * this workaround invokes undefined behavior, but it works as desired. + */ +# define BOOST_PP_TUPLE_REVERSE_DELAY(N,T) BOOST_PP_TUPLE##N##_REVERSE##T +#else +# define BOOST_PP_TUPLE_REVERSE_DELAY(N,T) BOOST_PP_TUPLE##N##_REVERSE T +#endif #define BOOST_PP_TUPLE0_REVERSE() () #define BOOST_PP_TUPLE1_REVERSE(A) (A) #define BOOST_PP_TUPLE2_REVERSE(A,B) (B,A) diff --git a/include/boost/preprocessor/tuple/to_list.hpp b/include/boost/preprocessor/tuple/to_list.hpp index b9df7c2..14f9edf 100644 --- a/include/boost/preprocessor/tuple/to_list.hpp +++ b/include/boost/preprocessor/tuple/to_list.hpp @@ -40,7 +40,14 @@ #define BOOST_PP_TUPLE_TO_LIST(N,T) BOOST_PP_TUPLE_TO_LIST_DELAY(N,T) #ifndef DOXYGEN_SHOULD_SKIP_THIS -#define BOOST_PP_TUPLE_TO_LIST_DELAY(N,T) BOOST_PP_TUPLE##N##_TO_LIST T +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +/* This is a workaround for a CodeWarrior PP bug. Strictly speaking + * this workaround invokes undefined behavior, but it works as desired. + */ +# define BOOST_PP_TUPLE_TO_LIST_DELAY(N,T) BOOST_PP_TUPLE##N##_TO_LIST##T +#else +# define BOOST_PP_TUPLE_TO_LIST_DELAY(N,T) BOOST_PP_TUPLE##N##_TO_LIST T +#endif #define BOOST_PP_TUPLE0_TO_LIST() (_,_,0) #define BOOST_PP_TUPLE1_TO_LIST(A) (A,(_,_,0),1) #define BOOST_PP_TUPLE2_TO_LIST(A,B) (A,(B,(_,_,0),1),1)