diff --git a/include/boost/python/detail/arg_tuple_size.hpp b/include/boost/python/detail/arg_tuple_size.hpp index e958c1c0..be63504e 100644 --- a/include/boost/python/detail/arg_tuple_size.hpp +++ b/include/boost/python/detail/arg_tuple_size.hpp @@ -14,8 +14,9 @@ # include # include # include -# include # include +# include +# include namespace boost { namespace python { namespace detail { @@ -33,18 +34,18 @@ template struct arg_tuple_size; // Specializations for function pointers # define BOOST_PYTHON_ARG_TUPLE_SIZE_PF(args, ignored) \ -template \ +template \ struct arg_tuple_size \ { \ BOOST_STATIC_CONSTANT(std::size_t, value = args); \ }; // Specializations for member function pointers -# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \ -template \ -struct arg_tuple_size \ -{ \ - BOOST_STATIC_CONSTANT(std::size_t, value = args); \ +# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \ +template \ +struct arg_tuple_size \ +{ \ + BOOST_STATIC_CONSTANT(std::size_t, value = args); \ }; # else @@ -60,12 +61,12 @@ struct arg_tuple_size \ // their return value is used to discriminate between various free // and member function pointers at compile-time. -# define BOOST_PYTHON_ARG_TUPLE_SIZE_PF(args, ignored) \ -template \ +# define BOOST_PYTHON_ARG_TUPLE_SIZE_PF(args, ignored) \ +template \ char_array arg_tuple_size_helper(BOOST_PYTHON_FN(*,0,args)); -# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \ -template \ +# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \ +template \ char_array arg_tuple_size_helper(BOOST_PYTHON_FN(A0::*,1,args)cv()); # endif diff --git a/include/boost/python/detail/caller.hpp b/include/boost/python/detail/caller.hpp index 87ea5405..4b70f1a8 100644 --- a/include/boost/python/detail/caller.hpp +++ b/include/boost/python/detail/caller.hpp @@ -8,12 +8,12 @@ # include # include -# include +# include # include # include # include -# include # include +# include namespace boost { namespace python { @@ -30,33 +30,33 @@ struct caller # include # endif -# define BOOST_PYTHON_CALLER_PF(args_, ignored) \ -template < \ - class P \ - , class R \ - BOOST_PP_COMMA_IF(args_) BOOST_MPL_TEMPLATE_PARAMETERS(0, args_, class A) \ - > \ -PyObject* operator()( \ - BOOST_PYTHON_FN(*f,0,args_) \ - , PyObject* args, PyObject* keywords \ - , P const& policies \ - ) const \ -{ \ - return returning::call(f, args, keywords,&policies); \ +# define BOOST_PYTHON_CALLER_PF(args_, ignored) \ +template < \ + class P \ + , class R \ + BOOST_PP_COMMA_IF(args_) BOOST_PP_ENUM_PARAMS(args_, class A) \ + > \ +PyObject* operator()( \ + BOOST_PYTHON_FN(*f,0,args_) \ + , PyObject* args, PyObject* keywords \ + , P const& policies \ + ) const \ +{ \ + return returning::call(f, args, keywords,&policies); \ } BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_CALLER_PF, nil) // Member functions -# define BOOST_PYTHON_CALLER_PMF(args_, cv) \ -template \ -PyObject* operator()( \ - BOOST_PYTHON_FN(A0::*f,1,args_)cv() \ - , PyObject* args, PyObject* keywords \ - , P const& policies \ - ) const \ -{ \ - return returning::call(f, args, keywords,&policies); \ +# define BOOST_PYTHON_CALLER_PMF(args_, cv) \ +template \ +PyObject* operator()( \ + BOOST_PYTHON_FN(A0::*f,1,args_)cv() \ + , PyObject* args, PyObject* keywords \ + , P const& policies \ + ) const \ +{ \ + return returning::call(f, args, keywords,&policies); \ } BOOST_PYTHON_REPEAT_MF_ALL_CV_2ND(BOOST_PYTHON_CALLER_PMF)