From 6d04d3068b8163b27960da846c4f5cb1076846f6 Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Fri, 25 Jan 2002 13:15:56 +0000 Subject: [PATCH] MWCW workarounds [SVN r12497] --- include/boost/preprocessor/arithmetic/add.hpp | 9 +++++-- include/boost/preprocessor/arithmetic/div.hpp | 9 +++++-- include/boost/preprocessor/arithmetic/mul.hpp | 9 +++++-- include/boost/preprocessor/arithmetic/sub.hpp | 9 +++++-- include/boost/preprocessor/enum.hpp | 6 ++++- .../enum_params_with_a_default.hpp | 6 ++++- .../enum_params_with_defaults.hpp | 6 ++++- include/boost/preprocessor/enum_shifted.hpp | 6 ++++- include/boost/preprocessor/list/adt.hpp | 24 +++++++++++++++---- include/boost/preprocessor/list/filter.hpp | 4 +++- include/boost/preprocessor/list/first_n.hpp | 9 +++++-- include/boost/preprocessor/list/fold_left.hpp | 8 +++++-- .../boost/preprocessor/list/fold_right.hpp | 4 +++- include/boost/preprocessor/list/for_each.hpp | 16 +++++++++---- include/boost/preprocessor/list/rest_n.hpp | 9 +++++-- include/boost/preprocessor/list/transform.hpp | 4 +++- 16 files changed, 108 insertions(+), 30 deletions(-) diff --git a/include/boost/preprocessor/arithmetic/add.hpp b/include/boost/preprocessor/arithmetic/add.hpp index 920cd05..355a20d 100644 --- a/include/boost/preprocessor/arithmetic/add.hpp +++ b/include/boost/preprocessor/arithmetic/add.hpp @@ -30,8 +30,13 @@ For example, BOOST_PP_ADD(4,3) expands to 7 (a single token). #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_ADD_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_ADD_C,BOOST_PP_ADD_F,(X,Y))) -#define BOOST_PP_ADD_C(D,P) BOOST_PP_TUPLE2_ELEM1 P -#define BOOST_PP_ADD_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE2_ELEM0 P),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 P)) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_ADD_C(D,P) BOOST_PP_TUPLE_ELEM(2,1,P) +# define BOOST_PP_ADD_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,P)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,P))) +#else +# define BOOST_PP_ADD_C(D,P) BOOST_PP_TUPLE2_ELEM1 P +# define BOOST_PP_ADD_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE2_ELEM0 P),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 P)) +#endif #endif //! Obsolete. Use BOOST_PP_ADD(). diff --git a/include/boost/preprocessor/arithmetic/div.hpp b/include/boost/preprocessor/arithmetic/div.hpp index f77c8d0..d640bf3 100644 --- a/include/boost/preprocessor/arithmetic/div.hpp +++ b/include/boost/preprocessor/arithmetic/div.hpp @@ -28,8 +28,13 @@ For example, BOOST_PP_DIV(4,3) expands to 1 (a single token). #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_DIV_D(D,X,Y) BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_DIV_C,BOOST_PP_DIV_F,(0,X,Y))) -#define BOOST_PP_DIV_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE3_ELEM2 P,BOOST_PP_TUPLE3_ELEM1 P) -#define BOOST_PP_DIV_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE3_ELEM0 P),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_TUPLE3_ELEM2 P),BOOST_PP_TUPLE3_ELEM2 P) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_DIV_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE_ELEM(3,2,P),BOOST_PP_TUPLE_ELEM(3,1,P)) +# define BOOST_PP_DIV_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3,0,P)),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_TUPLE_ELEM(3,2,P)),BOOST_PP_TUPLE_ELEM(3,2,P)) +#else +# define BOOST_PP_DIV_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE3_ELEM2 P,BOOST_PP_TUPLE3_ELEM1 P) +# define BOOST_PP_DIV_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE3_ELEM0 P),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_TUPLE3_ELEM2 P),BOOST_PP_TUPLE3_ELEM2 P) +#endif #endif //! Obsolete. Use BOOST_PP_DIV(). diff --git a/include/boost/preprocessor/arithmetic/mul.hpp b/include/boost/preprocessor/arithmetic/mul.hpp index 143fa78..59fedef 100644 --- a/include/boost/preprocessor/arithmetic/mul.hpp +++ b/include/boost/preprocessor/arithmetic/mul.hpp @@ -27,8 +27,13 @@ For example, BOOST_PP_MUL(4,3) expands to 12 (a single token). #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_MUL_D(D,X,Y) BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_MUL_C,BOOST_PP_MUL_F,(0,X,Y))) -#define BOOST_PP_MUL_C(D,P) BOOST_PP_TUPLE3_ELEM2 P -#define BOOST_PP_MUL_F(D,P) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE3_ELEM0 P,BOOST_PP_TUPLE3_ELEM1 P),BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_DEC(BOOST_PP_TUPLE3_ELEM2 P)) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_MUL_C(D,P) BOOST_PP_TUPLE_ELEM(3,2,P) +# define BOOST_PP_MUL_F(D,P) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P)),BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,P))) +#else +# define BOOST_PP_MUL_C(D,P) BOOST_PP_TUPLE3_ELEM2 P +# define BOOST_PP_MUL_F(D,P) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE3_ELEM0 P,BOOST_PP_TUPLE3_ELEM1 P),BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_DEC(BOOST_PP_TUPLE3_ELEM2 P)) +#endif #endif //! Obsolete. Use BOOST_PP_MUL(). diff --git a/include/boost/preprocessor/arithmetic/sub.hpp b/include/boost/preprocessor/arithmetic/sub.hpp index c9f905f..fcbed86 100644 --- a/include/boost/preprocessor/arithmetic/sub.hpp +++ b/include/boost/preprocessor/arithmetic/sub.hpp @@ -29,8 +29,13 @@ For example, BOOST_PP_SUB(4,3) expands to 1 (a single token). #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_SUB_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_SUB_C,BOOST_PP_SUB_F,(X,Y))) -#define BOOST_PP_SUB_C(D,P) BOOST_PP_TUPLE2_ELEM1 P -#define BOOST_PP_SUB_F(D,P) (BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM0 P),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 P)) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_SUB_C(D,P) BOOST_PP_TUPLE_ELEM(2,1,P) +# define BOOST_PP_SUB_F(D,P) (BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,0,P)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,P))) +#else +# define BOOST_PP_SUB_C(D,P) BOOST_PP_TUPLE2_ELEM1 P +# define BOOST_PP_SUB_F(D,P) (BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM0 P),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 P)) +#endif #endif //! Obsolete. Use BOOST_PP_SUB(X,Y). diff --git a/include/boost/preprocessor/enum.hpp b/include/boost/preprocessor/enum.hpp index 2799159..bd12678 100644 --- a/include/boost/preprocessor/enum.hpp +++ b/include/boost/preprocessor/enum.hpp @@ -34,6 +34,10 @@ NOTE: The implementation uses BOOST_PP_REPEAT(). #define BOOST_PP_ENUM(N,F,P) BOOST_PP_REPEAT(N,BOOST_PP_ENUM_F,(F,P)) #ifndef DOXYGEN_SHOULD_SKIP_THIS -#define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE2_ELEM0 FP(I,BOOST_PP_TUPLE2_ELEM1 FP) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,FP)(I,BOOST_PP_TUPLE_ELEM(2,1,FP)) +#else +# define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE2_ELEM0 FP(I,BOOST_PP_TUPLE2_ELEM1 FP) +#endif #endif #endif diff --git a/include/boost/preprocessor/enum_params_with_a_default.hpp b/include/boost/preprocessor/enum_params_with_a_default.hpp index b9cacbb..f81f0ef 100644 --- a/include/boost/preprocessor/enum_params_with_a_default.hpp +++ b/include/boost/preprocessor/enum_params_with_a_default.hpp @@ -33,7 +33,11 @@ NOTE: The implementation uses BOOST_PP_REPEAT(). #define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F,(P,D)) #ifndef DOXYGEN_SHOULD_SKIP_THIS -#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_TUPLE2_ELEM1 PD +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_TUPLE_ELEM(2,1,PD) +#else +# define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_TUPLE2_ELEM1 PD +#endif #endif //! Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(). diff --git a/include/boost/preprocessor/enum_params_with_defaults.hpp b/include/boost/preprocessor/enum_params_with_defaults.hpp index e843fb3..a145128 100644 --- a/include/boost/preprocessor/enum_params_with_defaults.hpp +++ b/include/boost/preprocessor/enum_params_with_defaults.hpp @@ -33,7 +33,11 @@ NOTE: The implementation uses BOOST_PP_REPEAT(). #define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F,(P,D)) #ifndef DOXYGEN_SHOULD_SKIP_THIS -#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM1 PD,I) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,PD),I) +#else +# define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM1 PD,I) +#endif #endif //! Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(). diff --git a/include/boost/preprocessor/enum_shifted.hpp b/include/boost/preprocessor/enum_shifted.hpp index 38a4d24..03e45ca 100644 --- a/include/boost/preprocessor/enum_shifted.hpp +++ b/include/boost/preprocessor/enum_shifted.hpp @@ -34,6 +34,10 @@ NOTE: The implementation uses BOOST_PP_REPEAT(). #define BOOST_PP_ENUM_SHIFTED(N,F,P) BOOST_PP_ENUM(BOOST_PP_DEC(N),BOOST_PP_ENUM_SHIFTED_F,(F,P)) #ifndef DOXYGEN_SHOULD_SKIP_THIS -#define BOOST_PP_ENUM_SHIFTED_F(I,FP) BOOST_PP_TUPLE2_ELEM0 FP(BOOST_PP_INC(I),BOOST_PP_TUPLE2_ELEM1 FP) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_ENUM_SHIFTED_F(I,FP) BOOST_PP_TUPLE_ELEM(2,0,FP)(BOOST_PP_INC(I),BOOST_PP_TUPLE_ELEM(2,1,FP)) +#else +# define BOOST_PP_ENUM_SHIFTED_F(I,FP) BOOST_PP_TUPLE2_ELEM0 FP(BOOST_PP_INC(I),BOOST_PP_TUPLE2_ELEM1 FP) +#endif #endif #endif diff --git a/include/boost/preprocessor/list/adt.hpp b/include/boost/preprocessor/list/adt.hpp index 9c83bb6..dbe3028 100644 --- a/include/boost/preprocessor/list/adt.hpp +++ b/include/boost/preprocessor/list/adt.hpp @@ -60,13 +60,21 @@ See BOOST_PP_LIST_CONS(). /*! See BOOST_PP_LIST_IS_NIL(). */ -#define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE3_ELEM2 L +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE_ELEM(3,2,L) +#else +# define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE3_ELEM2 L +#endif //! Expands to 1 if the list is nil and 0 otherwise. /*! See BOOST_PP_LIST_IS_CONS(). */ -#define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 L) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,L)) +#else +# define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 L) +#endif //! Expands to the first element of the list. The list must not be nil. /*! @@ -80,7 +88,11 @@ expands to 1. See BOOST_PP_LIST_REST(). */ -#define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE3_ELEM0 L +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE_ELEM(3,0,L) +#else +# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE3_ELEM0 L +#endif //! Expands to a list of all but the first element of the list. The list must not be nil. /*! @@ -94,5 +106,9 @@ expands to a list containing 2, 3, 4 and 5. See BOOST_PP_LIST_FIRST(). */ -#define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE3_ELEM1 L +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE_ELEM(3,1,L) +#else +# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE3_ELEM1 L +#endif #endif diff --git a/include/boost/preprocessor/list/filter.hpp b/include/boost/preprocessor/list/filter.hpp index c320bed..85272dd 100644 --- a/include/boost/preprocessor/list/filter.hpp +++ b/include/boost/preprocessor/list/filter.hpp @@ -33,7 +33,9 @@ expands to a list containing 1 and 3. #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_LIST_FILTER_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_FILTER_F,L,(F,P,(_,_,0)))) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_FILTER_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(H,BOOST_PP_TUPLE_ELEM(3,2,P))) +#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) # define BOOST_PP_LIST_FILTER_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_IF(BOOST_PP_TUPLE3_ELEM0 P(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(H,BOOST_PP_TUPLE3_ELEM2 P)) #else # define BOOST_PP_LIST_FILTER_F(D,H,P) (BOOST_PP_TUPLE3_ELEM0 P,BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_IF(BOOST_PP_TUPLE3_ELEM0 P(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(H,BOOST_PP_TUPLE3_ELEM2 P)) diff --git a/include/boost/preprocessor/list/first_n.hpp b/include/boost/preprocessor/list/first_n.hpp index f2aec1d..2bb34bd 100644 --- a/include/boost/preprocessor/list/first_n.hpp +++ b/include/boost/preprocessor/list/first_n.hpp @@ -35,7 +35,12 @@ expands to a list containing + and -. #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_LIST_FIRST_N_D(D,N,L) BOOST_PP_LIST_REVERSE_D(D,BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_FIRST_N_C,BOOST_PP_LIST_FIRST_N_F,((_,_,0),L,N)))) -#define BOOST_PP_LIST_FIRST_N_C(D,X) BOOST_PP_TUPLE3_ELEM2 X -#define BOOST_PP_LIST_FIRST_N_F(D,X) ((BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_TUPLE3_ELEM0 X,1),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_DEC(BOOST_PP_TUPLE3_ELEM2 X)) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_FIRST_N_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,X) +# define BOOST_PP_LIST_FIRST_N_F(D,X) ((BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,1,X)),BOOST_PP_TUPLE_ELEM(3,0,X),1),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,1,X)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,X))) +#else +# define BOOST_PP_LIST_FIRST_N_C(D,X) BOOST_PP_TUPLE3_ELEM2 X +# define BOOST_PP_LIST_FIRST_N_F(D,X) ((BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_TUPLE3_ELEM0 X,1),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_DEC(BOOST_PP_TUPLE3_ELEM2 X)) +#endif #endif #endif diff --git a/include/boost/preprocessor/list/fold_left.hpp b/include/boost/preprocessor/list/fold_left.hpp index c96717e..1881f61 100644 --- a/include/boost/preprocessor/list/fold_left.hpp +++ b/include/boost/preprocessor/list/fold_left.hpp @@ -47,10 +47,14 @@ See BOOST_PP_LIST_FOLD_RIGHT(). #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_LIST_FOLD_LEFT_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_C,BOOST_PP_LIST_FOLD_LEFT_F,(F,P,L))) -#define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE3_ELEM2 X -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,X)) +# define BOOST_PP_LIST_FOLD_LEFT_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE_ELEM(3,0,X)(D,BOOST_PP_TUPLE_ELEM(3,1,X),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,X))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,X))) +#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) +# define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE3_ELEM2 X # define BOOST_PP_LIST_FOLD_LEFT_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE3_ELEM0 X(D,BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM2 X),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM2 X) #else +# define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE3_ELEM2 X # define BOOST_PP_LIST_FOLD_LEFT_F(D,X) (BOOST_PP_TUPLE3_ELEM0 X,BOOST_PP_TUPLE3_ELEM0 X(D,BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM2 X),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM2 X) #endif #endif diff --git a/include/boost/preprocessor/list/fold_right.hpp b/include/boost/preprocessor/list/fold_right.hpp index 0a50263..c06736c 100644 --- a/include/boost/preprocessor/list/fold_right.hpp +++ b/include/boost/preprocessor/list/fold_right.hpp @@ -51,7 +51,9 @@ See BOOST_PP_LIST_FOLD_LEFT(). #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_LIST_FOLD_RIGHT_D(D,F,L,P) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_FOLD_RIGHT_F,(F,P),BOOST_PP_LIST_REVERSE_D(D,L))) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_FOLD_RIGHT_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE_ELEM(2,1,P))) +#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) # define BOOST_PP_LIST_FOLD_RIGHT_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE2_ELEM1 P)) #else # define BOOST_PP_LIST_FOLD_RIGHT_F(D,P,H) (BOOST_PP_TUPLE2_ELEM0 P,BOOST_PP_TUPLE2_ELEM0 P(D,H,BOOST_PP_TUPLE2_ELEM1 P)) diff --git a/include/boost/preprocessor/list/for_each.hpp b/include/boost/preprocessor/list/for_each.hpp index 1cbd2f7..164e3d6 100644 --- a/include/boost/preprocessor/list/for_each.hpp +++ b/include/boost/preprocessor/list/for_each.hpp @@ -37,12 +37,18 @@ See BOOST_PP_FOR() for an explanation of the R parameter. #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_LIST_FOR_EACH_R(R,F,P,L) BOOST_PP_FOR##R((F,P,L,0),BOOST_PP_LIST_FOR_EACH_C,BOOST_PP_LIST_FOR_EACH_F,BOOST_PP_LIST_FOR_EACH_I) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) -# define BOOST_PP_LIST_FOR_EACH_C(R,FPL) BOOST_PP_LIST_IS_CONS(BOOST_PP_TUPLE4_ELEM2 FPL) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_FOR_EACH_C(R,FPL) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,2,FPL)) +# define BOOST_PP_LIST_FOR_EACH_F(R,FPL) (BOOST_PP_TUPLE_ELEM(4,0,FPL),BOOST_PP_TUPLE_ELEM(4,1,FPL),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(4,2,FPL)),BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4,3,FPL))) +# define BOOST_PP_LIST_FOR_EACH_I(R,FPL) BOOST_PP_TUPLE_ELEM(4,0,FPL)(BOOST_PP_TUPLE_ELEM(4,3,FPL),BOOST_PP_TUPLE_ELEM(4,1,FPL),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,2,FPL))) +#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) +# define BOOST_PP_LIST_FOR_EACH_C(R,FPL) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE4_ELEM2 FPL) +# define BOOST_PP_LIST_FOR_EACH_F(R,FPL) (BOOST_PP_TUPLE_ELEM(4,0,FPL),BOOST_PP_TUPLE4_ELEM1 FPL,BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE4_ELEM2 FPL,BOOST_PP_INC(BOOST_PP_TUPLE4_ELEM3 FPL)) +# define BOOST_PP_LIST_FOR_EACH_I(R,FPL) BOOST_PP_TUPLE4_ELEM0 FPL(BOOST_PP_TUPLE4_ELEM3 FPL,BOOST_PP_TUPLE4_ELEM1 FPL,BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE4_ELEM2 FPL) #else # define BOOST_PP_LIST_FOR_EACH_C(R,FPL) BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE4_ELEM2 FPL -#endif -#define BOOST_PP_LIST_FOR_EACH_F(R,FPL) (BOOST_PP_TUPLE_ELEM(4,0,FPL),BOOST_PP_TUPLE4_ELEM1 FPL,BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE4_ELEM2 FPL,BOOST_PP_INC(BOOST_PP_TUPLE4_ELEM3 FPL)) -#define BOOST_PP_LIST_FOR_EACH_I(R,FPL) BOOST_PP_TUPLE4_ELEM0 FPL(BOOST_PP_TUPLE4_ELEM3 FPL,BOOST_PP_TUPLE4_ELEM1 FPL,BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE4_ELEM2 FPL) +# define BOOST_PP_LIST_FOR_EACH_F(R,FPL) (BOOST_PP_TUPLE4_ELEM0 FPL,BOOST_PP_TUPLE4_ELEM1 FPL,BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE4_ELEM2 FPL,BOOST_PP_INC(BOOST_PP_TUPLE4_ELEM3 FPL)) +# define BOOST_PP_LIST_FOR_EACH_I(R,FPL) BOOST_PP_TUPLE4_ELEM0 FPL(BOOST_PP_TUPLE4_ELEM3 FPL,BOOST_PP_TUPLE4_ELEM1 FPL,BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE4_ELEM2 FPL) +#endif #endif #endif diff --git a/include/boost/preprocessor/list/rest_n.hpp b/include/boost/preprocessor/list/rest_n.hpp index 8e29f29..cce0755 100644 --- a/include/boost/preprocessor/list/rest_n.hpp +++ b/include/boost/preprocessor/list/rest_n.hpp @@ -35,7 +35,12 @@ expands to a list containing * and /. #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_LIST_REST_N_D(D,N,L) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_REST_N_C,BOOST_PP_LIST_REST_N_F,(L,N))) -#define BOOST_PP_LIST_REST_N_C(D,X) BOOST_PP_TUPLE2_ELEM1 X -#define BOOST_PP_LIST_REST_N_F(D,X) (BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE2_ELEM0 X,BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 X)) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_REST_N_C(D,X) BOOST_PP_TUPLE_ELEM(2,1,X) +# define BOOST_PP_LIST_REST_N_F(D,X) (BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,X))) +#else +# define BOOST_PP_LIST_REST_N_C(D,X) BOOST_PP_TUPLE2_ELEM1 X +# define BOOST_PP_LIST_REST_N_F(D,X) (BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE2_ELEM0 X,BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 X)) +#endif #endif #endif diff --git a/include/boost/preprocessor/list/transform.hpp b/include/boost/preprocessor/list/transform.hpp index 0e213a8..de5c84e 100644 --- a/include/boost/preprocessor/list/transform.hpp +++ b/include/boost/preprocessor/list/transform.hpp @@ -43,7 +43,9 @@ expands to a list containing 3 and 4. #ifndef DOXYGEN_SHOULD_SKIP_THIS #define BOOST_PP_LIST_TRANSFORM_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_TRANSFORM_F,L,(F,P,(_,_,0)))) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) +#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 +# define BOOST_PP_LIST_TRANSFORM_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P),(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE_ELEM(3,1,P),H),BOOST_PP_TUPLE_ELEM(3,2,P),1)) +#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) # define BOOST_PP_LIST_TRANSFORM_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE3_ELEM1 P,(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_TUPLE3_ELEM2 P,1)) #else # define BOOST_PP_LIST_TRANSFORM_F(D,H,P) (BOOST_PP_TUPLE3_ELEM0 P,BOOST_PP_TUPLE3_ELEM1 P,(BOOST_PP_TUPLE3_ELEM0 P(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_TUPLE3_ELEM2 P,1))