Fix SWIG_Py*Method_New conditional

This should be a SWIG-time conditional, but was inside %{ %} so was
instead a compile-time conditional.

Fix for bug in the changes in #2191
This commit is contained in:
Olly Betts 2022-03-14 12:49:41 +13:00
commit b4a92ae34f

View file

@ -107,8 +107,20 @@ SWIG_Python_FixMethods(PyMethodDef *methods, const swig_const_info *const_table,
}
}
#ifdef __cplusplus
}
#endif
%}
#if defined SWIGPYTHON_FASTPROXY && !defined SWIGPYTHON_BUILTIN
%init %{
#ifdef __cplusplus
extern "C" {
#endif
/* -----------------------------------------------------------------------------
* Method creation and docstring support functions
* ----------------------------------------------------------------------------- */
@ -167,12 +179,16 @@ SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyO
return PyStaticMethod_New(func);
}
#endif
#ifdef __cplusplus
}
#endif
%}
#endif
%init %{
/* -----------------------------------------------------------------------------*
* Partial Init method
* -----------------------------------------------------------------------------*/