From 32b963ef1caccf7bc941e16c9a6fc7abe8c8fd8d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 19 Feb 2019 22:54:08 +0000 Subject: [PATCH] Re-organise Python method creation and docstring functions declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix ‘PyMethodDef* SWIG_PythonGetProxyDoc(const char*)’ declared ‘static’ but never defined [-Wunused-function] Closes #1448 (again) --- Lib/python/pyinit.swg | 16 ++++++++++++++++ Lib/python/pyrun.swg | 6 ------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg index f5be6d599..dfbf40b34 100644 --- a/Lib/python/pyinit.swg +++ b/Lib/python/pyinit.swg @@ -8,6 +8,22 @@ %fragment(""); // For offsetof #endif +%insert(runtime) %{ +#ifdef __cplusplus +extern "C" { +#endif + +/* Method creation and docstring support functions */ + +SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); +SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); +SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); + +#ifdef __cplusplus +} +#endif +%} + %init %{ #ifdef __cplusplus diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index 693cd6d46..ad1b81963 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -213,12 +213,6 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi extern "C" { #endif -/* Method creation and docstring support functions */ - -SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); -SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); -SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); - /* The python void return value */ SWIGRUNTIMEINLINE PyObject *