From d6d23465e0ae5969b3e7c4d2e85962d8fcda6098 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 16 Sep 2006 09:57:26 +0000 Subject: Patch from Michal Marek for Python 2.5 to fix 64 bit array indexes git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9289 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/python/pyhead.swg | 5 +++++ Lib/python/pystrings.swg | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Lib/python') diff --git a/Lib/python/pyhead.swg b/Lib/python/pyhead.swg index 20fa33c9f..c6d19c864 100644 --- a/Lib/python/pyhead.swg +++ b/Lib/python/pyhead.swg @@ -78,3 +78,8 @@ PyObject *PyBool_FromLong(long ok) } #endif +/* Py_ssize_t for old Pythons */ +#if PY_VERSION_HEX < 0x02050000 +typedef int Py_ssize_t; +#endif + diff --git a/Lib/python/pystrings.swg b/Lib/python/pystrings.swg index 64172770f..d4d60c42b 100644 --- a/Lib/python/pystrings.swg +++ b/Lib/python/pystrings.swg @@ -6,7 +6,7 @@ SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { if (PyString_Check(obj)) { - char *cstr; int len; + char *cstr; Py_ssize_t len; PyString_AsStringAndSize(obj, &cstr, &len); if (cptr) { if (alloc) { -- cgit v1.2.1