summaryrefslogtreecommitdiff
path: root/Lib/python
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2019-02-19 22:54:08 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2019-02-19 22:54:08 +0000
commit32b963ef1caccf7bc941e16c9a6fc7abe8c8fd8d (patch)
tree24cc4e14bb8c59bc9677bbb7ad08b6789c7a73a4 /Lib/python
parent1f46d9b7b9d6b0e22a23d54a2d6e5695e6d95e76 (diff)
downloadswig-32b963ef1caccf7bc941e16c9a6fc7abe8c8fd8d.tar.gz
Re-organise Python method creation and docstring functions declarations
Fix ‘PyMethodDef* SWIG_PythonGetProxyDoc(const char*)’ declared ‘static’ but never defined [-Wunused-function] Closes #1448 (again)
Diffstat (limited to 'Lib/python')
-rw-r--r--Lib/python/pyinit.swg16
-rw-r--r--Lib/python/pyrun.swg6
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("<stddef.h>"); // 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 *