From: Gianni Tedesco Subject: [PATCH]: pyxl: fix build of python xl binding for python < 2.5 Date: Wed, 13 Oct 2010 17:56:29 +0100 Message-ID: <1286988989.12843.566.camel@qabil.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Devel , Ian Jackson Cc: "Jiang, Yunhong" List-Id: xen-devel@lists.xenproject.org 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. diff -r 38ad3633ecaf tools/python/xen/lowlevel/xl/xl.c --- a/tools/python/xen/lowlevel/xl/xl.c Wed Oct 13 12:01:30 2010 +0100 +++ b/tools/python/xen/lowlevel/xl/xl.c Wed Oct 13 17:51:44 2010 +0100 @@ -51,6 +51,10 @@ #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)