Skip to contentSkip to conversation

: pyxl: fix build of python xl binding for python < 2.5

PATCH Applied Gianni Tedesco 2 participants 2 messages Oct 13, 2010 – Oct 14, 2010 Arm/actions semi architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : pyxl: fix build of python xl binding for python < 2.5

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.

tools/python/xen/lowlevel/xl/xl.c +4 -0
diff -r 38ad3633ecaf tools/python/xen/lowlevel/xl/xl.c
@@ -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)
#1 lore raw
Quoted 3 lines · Gianni Tedesco

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.

applied, thanks