40
40
# include < boost/mpl/int.hpp>
41
41
# include < boost/mpl/next.hpp>
42
42
43
- namespace boost { namespace python { namespace detail {
43
+ namespace boost { namespace python { namespace detail {
44
44
45
45
template <int N>
46
46
inline PyObject* get (mpl::int_<N>, PyObject* const & args_)
47
47
{
48
- return PyTuple_GET_ITEM (args_,N);
48
+ return PyTuple_GetItem (args_,N);
49
49
}
50
50
51
51
inline Py_ssize_t arity (PyObject* const & args_)
52
52
{
53
- return PyTuple_GET_SIZE (args_);
53
+ return PyTuple_Size (args_);
54
54
}
55
55
56
56
// This "result converter" is really just used as
@@ -80,7 +80,7 @@ inline ResultConverter create_result_converter(
80
80
{
81
81
return ResultConverter (args_);
82
82
}
83
-
83
+
84
84
template <class ArgPackage , class ResultConverter >
85
85
inline ResultConverter create_result_converter (
86
86
ArgPackage const &
@@ -93,7 +93,7 @@ inline ResultConverter create_result_converter(
93
93
94
94
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
95
95
template <class ResultConverter >
96
- struct converter_target_type
96
+ struct converter_target_type
97
97
{
98
98
static PyTypeObject const *get_pytype ()
99
99
{
@@ -120,15 +120,15 @@ template<class Policies, class Sig> const signature_element* get_ret()
120
120
static const signature_element ret = {
121
121
(is_void<rtype>::value ? " void" : type_id<rtype>().name ())
122
122
, &detail::converter_target_type<result_converter>::get_pytype
123
- , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
123
+ , boost::detail::indirect_traits::is_reference_to_non_const<rtype>::value
124
124
};
125
125
126
126
return &ret;
127
127
}
128
128
129
129
#endif
130
130
131
-
131
+
132
132
template <unsigned > struct caller_arity ;
133
133
134
134
template <class F , class CallPolicies , class Sig >
@@ -187,7 +187,7 @@ struct caller
187
187
>::type base;
188
188
189
189
typedef PyObject* result_type;
190
-
190
+
191
191
caller (F f, CallPolicies p) : base(f,p) {}
192
192
193
193
};
@@ -217,14 +217,14 @@ struct caller_arity<N>
217
217
typedef typename first::type result_t ;
218
218
typedef typename select_result_converter<Policies, result_t >::type result_converter;
219
219
typedef typename Policies::argument_package argument_package;
220
-
220
+
221
221
argument_package inner_args (args_);
222
222
223
223
# if N
224
224
# define BOOST_PP_LOCAL_MACRO (i ) BOOST_PYTHON_ARG_CONVERTER(i)
225
225
# define BOOST_PP_LOCAL_LIMITS (0 , N-1 )
226
226
# include BOOST_PP_LOCAL_ITERATE()
227
- # endif
227
+ # endif
228
228
// all converters have been checked. Now we can do the
229
229
// precall part of the policy
230
230
if (!m_data.second ().precall (inner_args))
@@ -236,17 +236,17 @@ struct caller_arity<N>
236
236
, m_data.first ()
237
237
BOOST_PP_ENUM_TRAILING_PARAMS (N, c)
238
238
);
239
-
239
+
240
240
return m_data.second ().postcall (inner_args, result);
241
241
}
242
242
243
243
static unsigned min_arity () { return N; }
244
-
244
+
245
245
static py_func_sig_info signature ()
246
246
{
247
247
const signature_element * sig = detail::signature<Sig>::elements ();
248
248
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
249
- // MSVC 15.7.2, when compiling to /O2 left the static const signature_element ret,
249
+ // MSVC 15.7.2, when compiling to /O2 left the static const signature_element ret,
250
250
// originally defined here, uninitialized. This in turn led to SegFault in Python interpreter.
251
251
// Issue is resolved by moving the generation of ret to separate function in detail namespace (see above).
252
252
const signature_element * ret = detail::get_ret<Policies, Sig>();
@@ -265,6 +265,6 @@ struct caller_arity<N>
265
265
266
266
267
267
268
- #endif // BOOST_PP_IS_ITERATING
268
+ #endif // BOOST_PP_IS_ITERATING
269
269
270
270
0 commit comments