Skip to content

Commit bf9a033

Browse files
committed
Revert "Avoid multiple template instances of boost::python::details::get_signature when multiple calling conventions are enabled"
This reverts commit b49a186.
1 parent 2d9871f commit bf9a033

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

include/boost/python/signature.hpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,13 @@ struct most_derived
111111
// 'default' calling convention
112112

113113
# define BOOST_PYTHON_FN_CC
114-
# define BOOST_PYTHON_FN_CC_IS_DEFAULT
115114

116115
# define BOOST_PP_ITERATION_PARAMS_1 \
117116
(3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/signature.hpp>))
118117

119118
# include BOOST_PP_ITERATE()
120119

121120
# undef BOOST_PYTHON_FN_CC
122-
# undef BOOST_PYTHON_FN_CC_IS_DEFAULT
123121

124122
// __cdecl calling convention
125123

@@ -143,15 +141,13 @@ struct most_derived
143141
# if defined(BOOST_PYTHON_ENABLE_STDCALL)
144142

145143
# define BOOST_PYTHON_FN_CC __stdcall
146-
# define BOOST_PYTHON_FN_CC_IS_STDCALL
147144

148145
# define BOOST_PP_ITERATION_PARAMS_1 \
149146
(3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/signature.hpp>))
150147

151148
# include BOOST_PP_ITERATE()
152149

153150
# undef BOOST_PYTHON_FN_CC
154-
# undef BOOST_PYTHON_FN_CC_IS_STDCALL
155151

156152
# endif // defined(BOOST_PYTHON_ENABLE_STDCALL)
157153

@@ -160,14 +156,12 @@ struct most_derived
160156
# if defined(BOOST_PYTHON_ENABLE_FASTCALL)
161157

162158
# define BOOST_PYTHON_FN_CC __fastcall
163-
# define BOOST_PYTHON_FN_CC_IS_FASTCALL
164159

165160
# define BOOST_PP_ITERATION_PARAMS_1 \
166161
(3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/signature.hpp>))
167162

168163
# include BOOST_PP_ITERATE()
169164

170-
# undef BOOST_PYTHON_FN_CC_IS_FASTCALL
171165
# undef BOOST_PYTHON_FN_CC
172166

173167
# endif // defined(BOOST_PYTHON_ENABLE_FASTCALL)
@@ -190,8 +184,8 @@ struct most_derived
190184

191185
// as 'get_signature(RT(*)(T0...TN), void* = 0)' is the same
192186
// function as 'get_signature(RT(__cdecl *)(T0...TN), void* = 0)',
193-
// we don't define it multiple times (i.e. for __cdecl, __stdcall ...)
194-
# if defined(BOOST_PYTHON_FN_CC_IS_DEFAULT)
187+
// we don't define it twice
188+
# if !defined(BOOST_PYTHON_FN_CC_IS_CDECL)
195189

196190
template <
197191
class RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T)>
@@ -204,21 +198,19 @@ get_signature(RT(BOOST_PYTHON_FN_CC *)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)), void* =
204198
>();
205199
}
206200

207-
# endif // BOOST_PYTHON_FN_CC_IS_DEFAULT
201+
# endif // !defined(BOOST_PYTHON_FN_CC_IS_CDECL)
208202

209203
# undef N
210204

211205
# define BOOST_PP_ITERATION_PARAMS_2 \
212206
(3, (0, 3, <boost/python/signature.hpp>))
213207
# include BOOST_PP_ITERATE()
214208

215-
#else // BOOST_PP_ITERATION_DEPTH() != 1
209+
#else
216210

217211
# define N BOOST_PP_RELATIVE_ITERATION(1)
218212
# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_ITERATION())
219213

220-
# if defined(BOOST_PYTHON_FN_CC_IS_DEFAULT)
221-
222214
template <
223215
class RT, class ClassT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T)>
224216
inline BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))<
@@ -253,8 +245,6 @@ get_signature(
253245
>();
254246
}
255247

256-
# endif // BOOST_PYTHON_FN_CC_IS_DEFAULT
257-
258248
# undef Q
259249
# undef N
260250

0 commit comments

Comments
 (0)