pyxl: fix build of python xl binding for python < 2.5
authorGianni Tedesco <gianni.tedesco@citrix.com>
Thu, 14 Oct 2010 11:46:29 +0000 (12:46 +0100)
committerGianni Tedesco <gianni.tedesco@citrix.com>
Thu, 14 Oct 2010 11:46:29 +0000 (12:46 +0100)
The python C API introduced Py_ssize_t in version 2.5. Prior to this
int's were used instead. Fix the build by way of a heinous preprocessor
macro.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

tools/python/xen/lowlevel/xl/xl.c

index 6ac2cc42ffa0aa76b723051e0fbd2a12374c8b7a..7ab66f4f5200fd2425a050ad02f9187057122c63 100644 (file)
 
 #define CLS "ctx"
 
+#if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5)
+#define Py_ssize_t int
+#endif
+
 static PyObject *xl_error_obj;
 
 int genwrap__obj_init(PyObject *self, PyObject *args, PyObject *kwds)