diff --git a/include/boost/preprocessor.hpp b/include/boost/preprocessor.hpp index c9c2ada..f27fd74 100644 --- a/include/boost/preprocessor.hpp +++ b/include/boost/preprocessor.hpp @@ -26,6 +26,7 @@ Includes all PREPROCESSOR library headers. #include #include #include +#include #include #include #include diff --git a/test/for_test.cpp b/test/for_test.cpp new file mode 100644 index 0000000..346e5cd --- /dev/null +++ b/test/for_test.cpp @@ -0,0 +1,24 @@ +// Copyright (C) 2001 +// Housemarque Oy +// http://www.housemarque.com +// +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This +// software is provided "as is" without express or implied warranty, and +// with no claim as to its suitability for any purpose. + +// See http://www.boost.org for most recent version. + +#include +#include +#include + +#include + +// *** + +#define C(D,X) BOOST_PP_LESS_EQUAL(X,4) +#define F(D,X) BOOST_PP_INC(X) +#define I(D,X) -X + +TEST(11 BOOST_PP_FOR(0,C,F,I)) diff --git a/test/repeat_test.cpp b/test/repeat_test.cpp index 08c7db4..033bf78 100644 --- a/test/repeat_test.cpp +++ b/test/repeat_test.cpp @@ -25,17 +25,17 @@ #define ENUM_PARAMS_TEST_MAX 50 #endif -#define CONSTANT(I,A) const A##I = I; +#define CONSTANT(I,A) const BOOST_PP_CAT(A,I) = I; BOOST_PP_REPEAT(ENUM_PARAMS_TEST_MAX, CONSTANT, int default_param_) #undef CONSTANT #define TEST_ENUM_PARAMS(N)\ void BOOST_PP_CAT(test_enum_params,N)(\ - BOOST_PP_ENUM_PARAMS(N, double x));\ + BOOST_PP_ENUM_PARAMS(N, int x));\ void BOOST_PP_CAT(test_enum_params_with_a_default,N)(\ - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N, double x, 0));\ + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N, int x, 0));\ void BOOST_PP_CAT(test_enum_params_with_defaults,N)(\ - BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N, double x, default_param_)); + BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N, int x, default_param_)); TEST_ENUM_PARAMS(0) TEST_ENUM_PARAMS(ENUM_PARAMS_TEST_MAX)