From c74c467a09b857a7202590abe25b7c1e2af66ea6 Mon Sep 17 00:00:00 2001 From: Haoyu Bai Date: Sat, 28 Feb 2009 14:02:02 +0000 Subject: [PATCH] Fix SF#2637352, move declaration of SWIG_module before the call of SWIG_Python_FixMethods, since some C compiler don't allow declaration in middle of function body. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11140 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 5 +++++ Lib/python/pyinit.swg | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 66f3a87b7..bffefbb2b 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,11 @@ Version 1.3.39 (in progress) ============================ +2008-02-28: bhy + [Python] Fix SF#2637352. Move struct declaration of SWIG_module in pyinit.swg before + the method calls, since some C compiler don't allow declaration in middle of function + body. + 2008-02-21: wsfulton [Allegrocl] Fix seg fault wrapping some constant variable (%constant) types. diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg index ab55765ad..5fa50ecb8 100644 --- a/Lib/python/pyinit.swg +++ b/Lib/python/pyinit.swg @@ -318,10 +318,7 @@ SWIGEXPORT void #endif SWIG_init(void) { - PyObject *m, *d; - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); + PyObject *m, *d; #if PY_VERSION_HEX >= 0x03000000 static struct PyModuleDef SWIG_module = { PyModuleDef_HEAD_INIT, @@ -334,7 +331,12 @@ SWIG_init(void) { NULL, NULL }; +#endif + /* Fix SwigMethods to carry the callback ptrs when needed */ + SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); + +#if PY_VERSION_HEX >= 0x03000000 m = PyModule_Create(&SWIG_module); #else m = Py_InitModule((char *) SWIG_name, SwigMethods);