summaryrefslogtreecommitdiff
path: root/Lib/python
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2006-09-16 09:57:26 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2006-09-16 09:57:26 +0000
commitd6d23465e0ae5969b3e7c4d2e85962d8fcda6098 (patch)
tree1b87b78b5e3f5082d2ae1fdad19785c5ffb8319d /Lib/python
parent5d40ec2692621d35b2ea5fa1a532434991d4695b (diff)
downloadswig-d6d23465e0ae5969b3e7c4d2e85962d8fcda6098.tar.gz
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
Diffstat (limited to 'Lib/python')
-rw-r--r--Lib/python/pyhead.swg5
-rw-r--r--Lib/python/pystrings.swg2
2 files changed, 6 insertions, 1 deletions
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) {