Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73290 - in branches/pplib/v2: boost/preprocessor/debug boost/preprocessor/facilities libs/preprocessor/test
From: eldiener_at_[hidden]
Date: 2011-07-21 18:13:26


Author: eldiener
Date: 2011-07-21 18:13:25 EDT (Thu, 21 Jul 2011)
New Revision: 73290
URL: http://svn.boost.org/trac/boost/changeset/73290

Log:
Updated macros
Text files modified:
   branches/pplib/v2/boost/preprocessor/debug/assert_is_seq.hpp | 53 +++++++++++++++++++--
   branches/pplib/v2/boost/preprocessor/facilities/is_empty.hpp | 99 +++++++++++++++++++++++++++++++++++++++
   branches/pplib/v2/boost/preprocessor/facilities/is_tuple_begin.hpp | 11 ----
   branches/pplib/v2/libs/preprocessor/test/Jamfile.v2 | 87 +++++++++++++++++++++--------------
   branches/pplib/v2/libs/preprocessor/test/debug.cxx | 2
   5 files changed, 199 insertions(+), 53 deletions(-)

Modified: branches/pplib/v2/boost/preprocessor/debug/assert_is_seq.hpp
==============================================================================
--- branches/pplib/v2/boost/preprocessor/debug/assert_is_seq.hpp (original)
+++ branches/pplib/v2/boost/preprocessor/debug/assert_is_seq.hpp 2011-07-21 18:13:25 EDT (Thu, 21 Jul 2011)
@@ -14,6 +14,7 @@
 #
 # include <boost/preprocessor/config/config.hpp>
 # include <boost/preprocessor/comparison/equal.hpp>
+# include <boost/preprocessor/control/expr_iif.hpp>
 # include <boost/preprocessor/control/iif.hpp>
 # include <boost/preprocessor/control/while.hpp>
 # include <boost/preprocessor/debug/assert.hpp>
@@ -31,10 +32,6 @@
 # else
 #
 # define BOOST_PP_ASSERT_IS_SEQ(x) \
- BOOST_PP_ASSERT \
- ( \
- BOOST_PP_IS_TUPLE_BEGIN(x) \
- ) \
     BOOST_PP_IS_SEQ_DETAIL_GEN_EMPTY \
       ( \
       BOOST_PP_WHILE \
@@ -53,12 +50,28 @@
 # define BOOST_PP_IS_SEQ_DETAIL_GEN_EMPTY_I(x)
 #
 # define BOOST_PP_IS_SEQ_DETAIL_PRED(d,state) \
- BOOST_PP_IS_TUPLE_BEGIN(state) \
+ BOOST_PP_IIF \
+ ( \
+ BOOST_PP_IS_TUPLE_BEGIN(state), \
+ BOOST_PP_IS_SEQ_DETAIL_GEN_ONE, \
+ BOOST_PP_IS_SEQ_DETAIL_NOT_NIL \
+ ) \
+ (state) \
 /**/
 #
 # define BOOST_PP_IS_SEQ_DETAIL_OP(d,state) \
     BOOST_PP_IIF \
       ( \
+ BOOST_PP_IS_TUPLE_BEGIN(state), \
+ BOOST_PP_IS_SEQ_DETAIL_CHECK_AFTER_FIRST_TUPLE, \
+ BOOST_PP_IS_SEQ_DETAIL_GEN_RETURN_ASSERT \
+ ) \
+ (state) \
+/**/
+#
+# define BOOST_PP_IS_SEQ_DETAIL_CHECK_AFTER_FIRST_TUPLE(state) \
+ BOOST_PP_IIF \
+ ( \
       BOOST_PP_IS_SEQ_DETAIL_IS_AFTER_FIRST_TUPLE(state), \
       BOOST_PP_IS_SEQ_DETAIL_GET_AFTER_FIRST_TUPLE, \
       BOOST_PP_IS_SEQ_DETAIL_GEN_NOT_TUPLE \
@@ -107,6 +120,23 @@
       ) \
 /**/
 #
+# define BOOST_PP_IS_SEQ_DETAIL_GEN_RETURN_ASSERT(x) \
+ BOOST_PP_ASSERT(0) \
+ BOOST_PP_IS_SEQ_DETAIL_NIL \
+/**/
+# define BOOST_PP_IS_SEQ_DETAIL_GEN_RETURN(x) \
+ BOOST_PP_IS_SEQ_DETAIL_NIL \
+/**/
+#
+# define BOOST_PP_IS_SEQ_DETAIL_NOT_NIL(x) \
+ BOOST_PP_NOT \
+ ( \
+ BOOST_PP_IS_SEQ_DETAIL_IS_NIL(x) \
+ ) \
+/**/
+#
+# define BOOST_PP_IS_SEQ_DETAIL_GEN_ONE(x) 1
+#
 # define BOOST_PP_IS_SEQ_DETAIL_EMPTY(...)
 #
 # define BOOST_PP_IS_SEQ_DETAIL_EMPTY_E(...) \
@@ -115,6 +145,19 @@
 #
 # define BOOST_PP_IS_SEQ_DETAIL_EMPTY_1(...)
 #
+# define BOOST_PP_IS_SEQ_DETAIL_IS_NIL(x) \
+ BOOST_PP_IS_EMPTY \
+ ( \
+ BOOST_PP_CAT \
+ ( \
+ BOOST_PP_IS_SEQ_DETAIL_HELPER_, \
+ x \
+ ) \
+ ) \
+/**/
+#
+# define BOOST_PP_IS_SEQ_DETAIL_HELPER_BOOST_PP_IS_SEQ_DETAIL_NIL
+#
 # endif /* NDEBUG */
 # endif /* BOOST_PP_VARIADICS */
 # endif /* BOOST_PREPROCESSOR_DEBUG_ASSERT_IS_SEQ_HPP */

Modified: branches/pplib/v2/boost/preprocessor/facilities/is_empty.hpp
==============================================================================
--- branches/pplib/v2/boost/preprocessor/facilities/is_empty.hpp (original)
+++ branches/pplib/v2/boost/preprocessor/facilities/is_empty.hpp 2011-07-21 18:13:25 EDT (Thu, 21 Jul 2011)
@@ -13,13 +13,106 @@
 # define BOOST_PREPROCESSOR_FACILITIES_IS_EMPTY_HPP
 #
 # include <boost/preprocessor/config/config.hpp>
+#
+# /* BOOST_PP_IS_EMPTY */
+#
+# if BOOST_PP_VARIADICS
+#
+# if BOOST_PP_VARIADICS_MSVC
+#
+# include <boost/preprocessor/arithmetic/dec.hpp>
+# include <boost/preprocessor/control/if.hpp>
+# include <boost/preprocessor/variadic/size.hpp>
+#
+# define BOOST_PP_IS_EMPTY_DETAIL_IS_TUPLE_BEGIN(x) \
+ BOOST_PP_DEC \
+ ( \
+ BOOST_PP_VARIADIC_SIZE \
+ ( \
+ BOOST_PP_IS_EMPTY_DETAIL_IS_TUPLE_BEGIN_DETAIL_EXPAND x \
+ ) \
+ ) \
+/**/
+#
+# define BOOST_PP_IS_EMPTY_DETAIL_IS_TUPLE_BEGIN_DETAIL_EXPAND(...) \
+ 1,1 \
+/**/
+#
+#define BOOST_PP_IS_EMPTY_DETAIL_PRIMITIVE_CAT(a, b) a ## b
+#define BOOST_PP_IS_EMPTY_DETAIL_IIF(bit) \
+ BOOST_PP_IS_EMPTY_DETAIL_PRIMITIVE_CAT(BOOST_PP_IS_EMPTY_DETAIL_IIF_,bit) \
+/**/
+#define BOOST_PP_IS_EMPTY_DETAIL_IIF_0(t, b) b
+#define BOOST_PP_IS_EMPTY_DETAIL_IIF_1(t, b) t
+#define BOOST_PP_IS_EMPTY(param) \
+ BOOST_PP_IS_EMPTY_DETAIL_IIF \
+ ( \
+ BOOST_PP_IS_EMPTY_DETAIL_IS_TUPLE_BEGIN \
+ ( \
+ param \
+ ) \
+ ) \
+ ( \
+ 0, \
+ BOOST_PP_IS_EMPTY_DETAIL_IS_TUPLE_BEGIN \
+ ( \
+ BOOST_PP_IS_EMPTY_DETAIL_IS_EMPTY_NON_FUNCTION_C param () \
+ ) \
+ ) \
+/**/
+# else
+#define BOOST_PP_IS_EMPTY_DETAIL_CAT(a, ...) BOOST_PP_IS_EMPTY_DETAIL_PRIMITIVE_CAT(a,__VA_ARGS__)
+#define BOOST_PP_IS_EMPTY_DETAIL_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
+#define BOOST_PP_IS_EMPTY_DETAIL_IIF(bit) \
+ BOOST_PP_IS_EMPTY_DETAIL_PRIMITIVE_CAT(BOOST_PP_IS_EMPTY_DETAIL_IIF_,bit) \
+/**/
+#define BOOST_PP_IS_EMPTY_DETAIL_IIF_0(t, ...) __VA_ARGS__
+#define BOOST_PP_IS_EMPTY_DETAIL_IIF_1(t, ...) t
+#define BOOST_PP_IS_EMPTY_DETAIL_SPLIT(i, ...) \
+ BOOST_PP_IS_EMPTY_DETAIL_PRIMITIVE_CAT(BOOST_PP_IS_EMPTY_DETAIL_SPLIT_,i)(__VA_ARGS__) \
+/**/
+#define BOOST_PP_IS_EMPTY_DETAIL_SPLIT_0(a, ...) a
+#define BOOST_PP_IS_EMPTY_DETAIL_SPLIT_1(a, ...) __VA_ARGS__
+#define BOOST_PP_IS_EMPTY_DETAIL_IS_VARIADIC(...) \
+ BOOST_PP_IS_EMPTY_DETAIL_SPLIT \
+ ( \
+ 0, \
+ BOOST_PP_IS_EMPTY_DETAIL_CAT \
+ ( \
+ BOOST_PP_IS_EMPTY_DETAIL_IS_VARIADIC_R_, \
+ BOOST_PP_IS_EMPTY_DETAIL_IS_VARIADIC_C __VA_ARGS__ \
+ ) \
+ ) \
+/**/
+#define BOOST_PP_IS_EMPTY_DETAIL_IS_VARIADIC_C(...) 1
+#define BOOST_PP_IS_EMPTY_DETAIL_IS_VARIADIC_R_1 1,
+#define BOOST_PP_IS_EMPTY_DETAIL_IS_VARIADIC_R_BOOST_PP_IS_EMPTY_DETAIL_IS_VARIADIC_C 0,
+#define BOOST_PP_IS_EMPTY(...) \
+ BOOST_PP_IS_EMPTY_DETAIL_IIF \
+ ( \
+ BOOST_PP_IS_EMPTY_DETAIL_IS_VARIADIC \
+ ( \
+ __VA_ARGS__ \
+ ) \
+ ) \
+ ( \
+ 0, \
+ BOOST_PP_IS_EMPTY_DETAIL_IS_VARIADIC \
+ ( \
+ BOOST_PP_IS_EMPTY_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \
+ ) \
+ ) \
+/**/
+# endif
+#define BOOST_PP_IS_EMPTY_DETAIL_IS_EMPTY_NON_FUNCTION_C() ()
+#
+# else
+#
 # include <boost/preprocessor/cat.hpp>
 # include <boost/preprocessor/tuple/elem.hpp>
 # include <boost/preprocessor/facilities/empty.hpp>
 # include <boost/preprocessor/detail/split.hpp>
 #
-# /* BOOST_PP_IS_EMPTY */
-#
 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
 # define BOOST_PP_IS_EMPTY(x) BOOST_PP_IS_EMPTY_I(x BOOST_PP_IS_EMPTY_HELPER)
 # define BOOST_PP_IS_EMPTY_I(contents) BOOST_PP_TUPLE_ELEM(2, 1, (BOOST_PP_IS_EMPTY_DEF_ ## contents()))
@@ -41,3 +134,5 @@
 # endif
 #
 # endif
+#
+# endif

Modified: branches/pplib/v2/boost/preprocessor/facilities/is_tuple_begin.hpp
==============================================================================
--- branches/pplib/v2/boost/preprocessor/facilities/is_tuple_begin.hpp (original)
+++ branches/pplib/v2/boost/preprocessor/facilities/is_tuple_begin.hpp 2011-07-21 18:13:25 EDT (Thu, 21 Jul 2011)
@@ -14,22 +14,13 @@
 #
 # include <boost/preprocessor/config/config.hpp>
 # include <boost/preprocessor/arithmetic/dec.hpp>
-# include <boost/preprocessor/control/if.hpp>
 # include <boost/preprocessor/variadic/size.hpp>
 #
 # /* BOOST_PP_IS_TUPLE_BEGIN */
 #
 # if BOOST_PP_VARIADICS
-# define BOOST_PP_IS_TUPLE_BEGIN(x) \
- BOOST_PP_IF \
- ( \
- BOOST_PP_IS_TUPLE_BEGIN_DETAIL(x), \
- 1, \
- 0 \
- ) \
-/**/
 #
-# define BOOST_PP_IS_TUPLE_BEGIN_DETAIL(x) \
+# define BOOST_PP_IS_TUPLE_BEGIN(x) \
     BOOST_PP_DEC \
       ( \
       BOOST_PP_VARIADIC_SIZE \

Modified: branches/pplib/v2/libs/preprocessor/test/Jamfile.v2
==============================================================================
--- branches/pplib/v2/libs/preprocessor/test/Jamfile.v2 (original)
+++ branches/pplib/v2/libs/preprocessor/test/Jamfile.v2 2011-07-21 18:13:25 EDT (Thu, 21 Jul 2011)
@@ -22,6 +22,7 @@
         [ compile comparison.cpp ]
         [ compile control.cpp ]
         [ compile debug.cpp ]
+ [ compile debug_test.cpp ]
         [ compile facilities.cpp ]
         [ compile iteration.cpp ]
         [ compile list.cpp ]
@@ -52,93 +53,109 @@
         [ compile tuple.cpp : <define>BOOST_PP_VARIADICS=0 : tuple_nvm ]
    ;
 
-test-suite preprocessor_dbg
+test-suite preprocessor_cpp_dbg
    :
- [ compile-fail debug_fail_tuple.cpp
+ [ compile-fail debug_fail_tuple.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_tuple_cpp
         ]
- [ compile-fail debug_fail_array.cpp
+ [ compile-fail debug_fail_array.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_array_cpp
         ]
- [ compile-fail debug_fail_list.cpp
+ [ compile-fail debug_fail_list.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_list_cpp
         ]
- [ compile-fail debug_fail_seq.cpp
+ [ compile-fail debug_fail_seq.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_seq_cpp
         ]
- [ compile-fail debug_fail_tuple_2.cpp
+ [ compile-fail debug_fail_tuple_2.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_tuple_2_cpp
         ]
- [ compile-fail debug_fail_array_2.cpp
+ [ compile-fail debug_fail_array_2.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_array_2_cpp
         ]
- [ compile-fail debug_fail_list_2.cpp
+ [ compile-fail debug_fail_list_2.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_list_2_cpp
         ]
- [ compile-fail debug_fail_seq_2.cpp
+ [ compile-fail debug_fail_seq_2.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_seq_2_cpp
         ]
- [ compile-fail debug_fail_tuple_3.cpp
+ [ compile-fail debug_fail_tuple_3.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_tuple_3_cpp
         ]
- [ compile-fail debug_fail_array_3.cpp
+ [ compile-fail debug_fail_array_3.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_array_3_cpp
         ]
- [ compile-fail debug_fail_list_3.cpp
+ [ compile-fail debug_fail_list_3.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_list_3_cpp
         ]
- [ compile-fail debug_fail_seq_3.cpp
+ [ compile-fail debug_fail_seq_3.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_seq_3_cpp
         ]
- [ compile-fail debug_fail_tuple_4.cpp
+ [ compile-fail debug_fail_tuple_4.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_tuple_4_cpp
         ]
- [ compile-fail debug_fail_array_4.cpp
+ [ compile-fail debug_fail_array_4.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_array_4_cpp
         ]
- [ compile-fail debug_fail_list_4.cpp
+ [ compile-fail debug_fail_list_4.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_list_4_cpp
         ]
- [ compile-fail debug_fail_seq_4.cpp
+ [ compile-fail debug_fail_seq_4.c
           : <variant>debug
             <define>BOOST_PP_VARIADICS=1
- <cxxflags>-std=c++0x
+ <cflags>-std=c++0x
+ : debug_fail_seq_4_cpp
         ]
- :
+ :
    <toolset>gcc
    ;
 
-test-suite preprocessor_dbg ;
+test-suite preprocessor_cpp_dbg ;
 
 test-suite preprocessor_c
    :

Modified: branches/pplib/v2/libs/preprocessor/test/debug.cxx
==============================================================================
--- branches/pplib/v2/libs/preprocessor/test/debug.cxx (original)
+++ branches/pplib/v2/libs/preprocessor/test/debug.cxx 2011-07-21 18:13:25 EDT (Thu, 21 Jul 2011)
@@ -22,7 +22,7 @@
 # line BOOST_PP_LINE(100, __FILE__)
 BEGIN __LINE__ == 100 END
 
-# if BOOST_PP_VARIADICS
+# if BOOST_PP_VARIADICS && !BOOST_PP_VARIADICS_MSVC
 
 BOOST_PP_ASSERT_IS_TUPLE((t,3,e,2))
 BOOST_PP_ASSERT_IS_TUPLE(((y,s,w),3,e,2))


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk