From b4a92ae34f6d39825bc0eba056d6983575db4695 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Mon, 14 Mar 2022 12:49:41 +1300 Subject: [PATCH] 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 --- Lib/python/pyinit.swg | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg index 53ee5a318..6833b455a 100644 --- a/Lib/python/pyinit.swg +++ b/Lib/python/pyinit.swg @@ -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 * -----------------------------------------------------------------------------*/