From: Robin Dunn Date: Thu, 29 Jun 2006 02:34:31 +0000 (+0000) Subject: Added SWIG patches to allow compiling the generated code with X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ae200bfcb537c475708959cb034be66eb0f5dcd4 Added SWIG patches to allow compiling the generated code with Python 2.5 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/SWIG/README.txt b/wxPython/SWIG/README.txt index 94aeba7c91..050d52e739 100644 --- a/wxPython/SWIG/README.txt +++ b/wxPython/SWIG/README.txt @@ -45,6 +45,9 @@ swig-1.3.29.patch Don't set a module attribute for the *_swigregister functions, just call the one in the extension module directly. + Fixes to allow compiling with Python 2.5 headers. + + ------------------------------------------------------------------------ swig-1.3.27.patch @@ -62,6 +65,7 @@ swig-1.3.27.patch Bug fix for SWIG's definition of the %makedefault macro. + Fixes to allow compiling with Python 2.5 headers. ------------------------------------------------------------------------ diff --git a/wxPython/SWIG/swig-1.3.27.patch b/wxPython/SWIG/swig-1.3.27.patch index aef25fe251..6bbca81d28 100644 --- a/wxPython/SWIG/swig-1.3.27.patch +++ b/wxPython/SWIG/swig-1.3.27.patch @@ -4,7 +4,7 @@ RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v retrieving revision 1.31 diff -u -4 -r1.31 Python.html --- Doc/Manual/Python.html 6 Oct 2005 21:49:58 -0000 1.31 -+++ Doc/Manual/Python.html 11 Feb 2006 18:59:48 -0000 ++++ Doc/Manual/Python.html 28 Jun 2006 22:22:00 -0000 @@ -4461,10 +4461,10 @@

26.10 Docstring Features

@@ -24,7 +24,7 @@ RCS file: /cvsroot/swig/SWIG/Lib/swig.swg,v retrieving revision 1.49 diff -u -4 -r1.49 swig.swg --- Lib/swig.swg 15 Oct 2005 00:15:30 -0000 1.49 -+++ Lib/swig.swg 11 Feb 2006 18:59:48 -0000 ++++ Lib/swig.swg 28 Jun 2006 22:22:00 -0000 @@ -51,9 +51,9 @@ #define %nodefault %feature("nodefault","1") @@ -42,7 +42,7 @@ RCS file: /cvsroot/swig/SWIG/Lib/swiginit.swg,v retrieving revision 1.5 diff -u -4 -r1.5 swiginit.swg --- Lib/swiginit.swg 12 Sep 2005 23:25:03 -0000 1.5 -+++ Lib/swiginit.swg 11 Feb 2006 18:59:48 -0000 ++++ Lib/swiginit.swg 28 Jun 2006 22:22:00 -0000 @@ -40,14 +40,19 @@ **/ @@ -192,7 +192,7 @@ RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v retrieving revision 1.107 diff -u -4 -r1.107 python.cxx --- Source/Modules/python.cxx 7 Oct 2005 13:17:41 -0000 1.107 -+++ Source/Modules/python.cxx 11 Feb 2006 18:59:48 -0000 ++++ Source/Modules/python.cxx 28 Jun 2006 22:22:01 -0000 @@ -36,9 +36,8 @@ static File *f_directors_h = 0; static File *f_init = 0; @@ -267,3 +267,44 @@ diff -u -4 -r1.107 python.cxx } if (name) { +Index: Lib/python/pyinit.swg +=================================================================== +RCS file: /cvsroot/swig/SWIG/Lib/python/pyinit.swg,v +retrieving revision 1.19 +diff -u -4 -r1.19 pyinit.swg +--- Lib/python/pyinit.swg 17 Jun 2005 19:12:20 -0000 1.19 ++++ Lib/python/pyinit.swg 28 Jun 2006 22:22:01 -0000 +@@ -214,13 +214,13 @@ + swig_type_info **types, + swig_type_info **types_initial) { + size_t i; + for (i = 0; methods[i].ml_name; ++i) { +- char *c = methods[i].ml_doc; ++ const char *c = methods[i].ml_doc; + if (c && (c = strstr(c, "swig_ptr: "))) { + int j; + swig_const_info *ci = 0; +- char *name = c + 10; ++ const char *name = c + 10; + for (j = 0; const_table[j].type; ++j) { + if (strncmp(const_table[j].name, name, + strlen(const_table[j].name)) == 0) { + ci = &(const_table[j]); +Index: Lib/python/pyrun.swg +=================================================================== +RCS file: /cvsroot/swig/SWIG/Lib/python/pyrun.swg,v +retrieving revision 1.73 +diff -u -4 -r1.73 pyrun.swg +--- Lib/python/pyrun.swg 23 Aug 2005 10:55:05 -0000 1.73 ++++ Lib/python/pyrun.swg 28 Jun 2006 22:22:01 -0000 +@@ -635,9 +635,9 @@ + if (pyobj && !obj) { + obj = pyobj; + if (PyCFunction_Check(obj)) { + /* here we get the method pointer for callbacks */ +- char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); ++ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); + c = doc ? strstr(doc, "swig_ptr: ") : 0; + if (c) { + c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0; + if (!c) goto type_error; diff --git a/wxPython/SWIG/swig-1.3.29.patch b/wxPython/SWIG/swig-1.3.29.patch index 0da5923ce4..55a576f268 100644 --- a/wxPython/SWIG/swig-1.3.29.patch +++ b/wxPython/SWIG/swig-1.3.29.patch @@ -4,7 +4,7 @@ RCS file: /cvsroot/swig/SWIG/Makefile.in,v retrieving revision 1.103 diff -u -4 -r1.103 Makefile.in --- Makefile.in 10 Mar 2006 22:54:02 -0000 1.103 -+++ Makefile.in 18 May 2006 15:25:54 -0000 ++++ Makefile.in 28 Jun 2006 23:47:45 -0000 @@ -21,9 +21,9 @@ source: @@ -33,7 +33,7 @@ RCS file: /cvsroot/swig/SWIG/Lib/typemaps/exception.swg,v retrieving revision 1.8 diff -u -4 -r1.8 exception.swg --- Lib/typemaps/exception.swg 7 Mar 2006 00:14:10 -0000 1.8 -+++ Lib/typemaps/exception.swg 18 May 2006 15:25:54 -0000 ++++ Lib/typemaps/exception.swg 28 Jun 2006 23:47:45 -0000 @@ -12,9 +12,9 @@ /* macros for error manipulation */ @@ -51,7 +51,7 @@ RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v retrieving revision 1.203 diff -u -4 -r1.203 python.cxx --- Source/Modules/python.cxx 16 Mar 2006 01:46:50 -0000 1.203 -+++ Source/Modules/python.cxx 18 May 2006 15:25:54 -0000 ++++ Source/Modules/python.cxx 28 Jun 2006 23:47:46 -0000 @@ -39,9 +39,8 @@ static File *f_directors_h = 0; static File *f_init = 0; @@ -140,7 +140,7 @@ RCS file: /cvsroot/swig/SWIG/Source/Swig/misc.c,v retrieving revision 1.57 diff -u -4 -r1.57 misc.c --- Source/Swig/misc.c 6 Mar 2006 22:51:00 -0000 1.57 -+++ Source/Swig/misc.c 18 May 2006 15:25:54 -0000 ++++ Source/Swig/misc.c 28 Jun 2006 23:47:46 -0000 @@ -899,8 +899,26 @@ } #endif @@ -180,3 +180,26 @@ diff -u -4 -r1.57 misc.c Swig_keys_init(); /* Initialize typemaps */ +Index: Lib/python/pyinit.swg +=================================================================== +RCS file: /cvsroot/swig/SWIG/Lib/python/pyinit.swg,v +retrieving revision 1.32 +diff -u -4 -r1.32 pyinit.swg +--- Lib/python/pyinit.swg 2 Feb 2006 23:48:56 -0000 1.32 ++++ Lib/python/pyinit.swg 28 Jun 2006 23:47:46 -0000 +@@ -225,13 +225,13 @@ + swig_type_info **types, + swig_type_info **types_initial) { + size_t i; + for (i = 0; methods[i].ml_name; ++i) { +- char *c = methods[i].ml_doc; ++ const char *c = methods[i].ml_doc; + if (c && (c = strstr(c, "swig_ptr: "))) { + int j; + swig_const_info *ci = 0; +- char *name = c + 10; ++ const char *name = c + 10; + for (j = 0; const_table[j].type; ++j) { + if (strncmp(const_table[j].name, name, + strlen(const_table[j].name)) == 0) { + ci = &(const_table[j]);