Commit 7c1db227 authored by Shane Hathaway's avatar Shane Hathaway

Made compatible with Python 2.5 on 64 bit architectures. See PEP 353.

parent 3b242da0
...@@ -620,14 +620,14 @@ wrap_nonzero(PyObject *self) ...@@ -620,14 +620,14 @@ wrap_nonzero(PyObject *self)
* Sequence methods * Sequence methods
*/ */
static int static Py_ssize_t
wrap_length(PyObject *self) wrap_length(PyObject *self)
{ {
return PyObject_Length(Proxy_GET_OBJECT(self)); return PyObject_Length(Proxy_GET_OBJECT(self));
} }
static PyObject * static PyObject *
wrap_slice(PyObject *self, int start, int end) wrap_slice(PyObject *self, Py_ssize_t start, Py_ssize_t end)
{ {
PyObject *obj = Proxy_GET_OBJECT(self); PyObject *obj = Proxy_GET_OBJECT(self);
if (PyList_Check(obj)) { if (PyList_Check(obj)) {
...@@ -642,7 +642,7 @@ wrap_slice(PyObject *self, int start, int end) ...@@ -642,7 +642,7 @@ wrap_slice(PyObject *self, int start, int end)
} }
static int static int
wrap_ass_slice(PyObject *self, int i, int j, PyObject *value) wrap_ass_slice(PyObject *self, Py_ssize_t i, Py_ssize_t j, PyObject *value)
{ {
PyObject *obj = Proxy_GET_OBJECT(self); PyObject *obj = Proxy_GET_OBJECT(self);
if (PyList_Check(obj)) { if (PyList_Check(obj)) {
......
#ifndef _proxy_H_ #ifndef _proxy_H_
#define _proxy_H_ 1 #define _proxy_H_ 1
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
typedef Py_ssize_t (*lenfunc)(PyObject *);
typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t);
typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t);
typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *);
typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
#endif
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD
PyObject *proxy_object; PyObject *proxy_object;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment