Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73960 - sandbox/enums/boost/enums/pp
From: vicente.botet_at_[hidden]
Date: 2011-08-20 17:42:11


Author: viboes
Date: 2011-08-20 17:42:10 EDT (Sat, 20 Aug 2011)
New Revision: 73960
URL: http://svn.boost.org/trac/boost/changeset/73960

Log:
remove PP warnings
Text files modified:
   sandbox/enums/boost/enums/pp/namespaces.hpp | 22 ++++++++++++++++++++--
   1 files changed, 20 insertions(+), 2 deletions(-)

Modified: sandbox/enums/boost/enums/pp/namespaces.hpp
==============================================================================
--- sandbox/enums/boost/enums/pp/namespaces.hpp (original)
+++ sandbox/enums/boost/enums/pp/namespaces.hpp 2011-08-20 17:42:10 EDT (Sat, 20 Aug 2011)
@@ -96,9 +96,18 @@
 #define BOOST_ENUMS_NAMESPACES_OPEN_(r, data, elem) namespace elem {
 #endif
 
-#define BOOST_ENUMS_NAMESPACES_OPEN(SEQ) \
+#define BOOST_ENUMS_NAMESPACES_OPEN_NOT_EMPTY(SEQ) \
   BOOST_PP_SEQ_FOR_EACH(BOOST_ENUMS_NAMESPACES_OPEN_, ~, SEQ)
 
+#define BOOST_ENUMS_NAMESPACES_OPEN_EMPTY(SEQ) \
+
+#define BOOST_ENUMS_NAMESPACES_OPEN(SEQ) \
+ BOOST_PP_IIF( \
+ BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(SEQ),0) \
+ , BOOST_ENUMS_NAMESPACES_OPEN_EMPTY \
+ , BOOST_ENUMS_NAMESPACES_OPEN_NOT_EMPTY \
+ )(SEQ)
+
 /**
 
  @brief Generate the closing of the namespaces in @c NAMESPACES.
@@ -113,9 +122,18 @@
  */
 
 #define BOOST_ENUMS_NAMESPACES_CLOSE_(r, data, elem) }
-#define BOOST_ENUMS_NAMESPACES_CLOSE(SEQ) \
+#define BOOST_ENUMS_NAMESPACES_CLOSE_EMPTY(SEQ)
+
+#define BOOST_ENUMS_NAMESPACES_CLOSE_NOT_EMPTY(SEQ) \
   BOOST_PP_SEQ_FOR_EACH(BOOST_ENUMS_NAMESPACES_CLOSE_, ~, SEQ)
 
+#define BOOST_ENUMS_NAMESPACES_CLOSE(SEQ) \
+ BOOST_PP_IIF( \
+ BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(SEQ),0) \
+ , BOOST_ENUMS_NAMESPACES_CLOSE_EMPTY \
+ , BOOST_ENUMS_NAMESPACES_CLOSE_NOT_EMPTY \
+ )(SEQ)
+
 #ifndef BOOST_ENUMS_DOXYGEN_INVOKED
 // (NS1) ... (NSn)
 // ==>


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