From b12333b41917c583256f9e02c10a34ceef59968e Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Mon, 18 May 2015 02:14:35 -0400 Subject: [PATCH] Fixed problem when repetitions go past 256 and the 257th loop op returns that the repetitions are finished. --- include/boost/preprocessor/repetition/for.hpp | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/boost/preprocessor/repetition/for.hpp b/include/boost/preprocessor/repetition/for.hpp index 5a63753..c38946b 100644 --- a/include/boost/preprocessor/repetition/for.hpp +++ b/include/boost/preprocessor/repetition/for.hpp @@ -16,6 +16,8 @@ # # include # include +# include +# include # include # # /* BOOST_PP_FOR */ @@ -42,7 +44,23 @@ # include # endif # -# define BOOST_PP_FOR_257(s, p, o, m) BOOST_PP_ERROR(0x0002) +# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC() +# define BOOST_PP_FOR_257_PR(s, p) BOOST_PP_BOOL(p##(257, s)) +# else +# define BOOST_PP_FOR_257_PR(s, p) BOOST_PP_BOOL(p(257, s)) +# endif + +# define BOOST_PP_FOR_257_ERROR() BOOST_PP_ERROR(0x0002) +# define BOOST_PP_FOR_257(s, p, o, m) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_FOR_257_PR(s,p), \ + BOOST_PP_FOR_257_ERROR, \ + BOOST_PP_EMPTY \ + ) \ + () \ +/**/ +// # define BOOST_PP_FOR_257(s, p, o, m) BOOST_PP_ERROR(0x0002) # # define BOOST_PP_FOR_CHECK_BOOST_PP_NIL 1 #