Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71892 - in trunk/boost/signals2: . detail
From: fmhess_at_[hidden]
Date: 2011-05-12 10:41:19


Author: fmhess
Date: 2011-05-12 10:41:18 EDT (Thu, 12 May 2011)
New Revision: 71892
URL: http://svn.boost.org/trac/boost/changeset/71892

Log:
Fix warnings about empty macro arguments with gcc 4.4 -pedantic.

Text files modified:
   trunk/boost/signals2/detail/signals_common_macros.hpp | 15 +++++++++++----
   trunk/boost/signals2/preprocessed_signal.hpp | 1 +
   trunk/boost/signals2/variadic_signal.hpp | 1 +
   3 files changed, 13 insertions(+), 4 deletions(-)

Modified: trunk/boost/signals2/detail/signals_common_macros.hpp
==============================================================================
--- trunk/boost/signals2/detail/signals_common_macros.hpp (original)
+++ trunk/boost/signals2/detail/signals_common_macros.hpp 2011-05-12 10:41:18 EDT (Thu, 12 May 2011)
@@ -46,18 +46,21 @@
   typename BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) \
   BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
 // typename R, typename T1, typename T2, ..., typename TN
-#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity,)
+#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) \
+ typename R BOOST_PP_COMMA_IF(arity) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename T)
 // typename prefixT1, typename prefixT2, ..., typename prefixTN
 #define BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(arity, prefix) \
   BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
 // typename T1, typename T2, ..., typename TN
-#define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(arity,)
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename T)
 // prefixR, prefixT1, prefixT2, ..., prefixTN
 #define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity, prefix) \
   BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), BOOST_PP_CAT(prefix, T))
 // R, T1, T2, ..., TN
 #define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) \
- BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity,)
+ R BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
 // boost::functionN<R, T1, T2, ..., TN>
 #define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) BOOST_PP_CAT(boost::function, arity)<\
   BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) >
@@ -96,8 +99,12 @@
 // prefixT1 & arg1, prefixT2 & arg2, ..., prefixTn & argn
 #define BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(arity, prefix) \
   BOOST_PP_ENUM(arity, BOOST_SIGNALS2_PREFIXED_FULL_REF_ARG, prefix)
+// Tn & argn
+#define BOOST_SIGNALS2_FULL_REF_ARG(z, n, data) \
+ BOOST_PP_CAT(T, BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
 // T1 & arg1, T2 & arg2, ..., Tn & argn
-#define BOOST_SIGNALS2_FULL_REF_ARGS(arity) BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(arity,)
+#define BOOST_SIGNALS2_FULL_REF_ARGS(arity) \
+ BOOST_PP_ENUM(arity, BOOST_SIGNALS2_FULL_REF_ARG, ~)
 // preprocessed_arg_typeN
 #define BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(arity) BOOST_PP_CAT(preprocessed_arg_type, arity)
 

Modified: trunk/boost/signals2/preprocessed_signal.hpp
==============================================================================
--- trunk/boost/signals2/preprocessed_signal.hpp (original)
+++ trunk/boost/signals2/preprocessed_signal.hpp 2011-05-12 10:41:18 EDT (Thu, 12 May 2011)
@@ -17,6 +17,7 @@
 
 #include <boost/preprocessor/arithmetic.hpp>
 #include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/control/expr_if.hpp>
 #include <boost/preprocessor/iteration.hpp>
 #include <boost/preprocessor/repetition.hpp>
 #include <boost/signals2/detail/preprocessed_arg_type.hpp>

Modified: trunk/boost/signals2/variadic_signal.hpp
==============================================================================
--- trunk/boost/signals2/variadic_signal.hpp (original)
+++ trunk/boost/signals2/variadic_signal.hpp 2011-05-12 10:41:18 EDT (Thu, 12 May 2011)
@@ -16,6 +16,7 @@
 #ifndef BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
 #define BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
 
+#include <boost/preprocessor/control/expr_if.hpp>
 #include <boost/signals2/detail/variadic_arg_type.hpp>
 #include <boost/signals2/detail/variadic_slot_invoker.hpp>
 #include <boost/type_traits/function_traits.hpp>


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