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
This commit is contained in:
William S Fulton 2006-09-16 09:57:26 +00:00
commit d6d23465e0
2 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -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) {