[Libguestfs] [PATCH] Build workaround for Python 2.4.x in RHEL 5.
Richard W.M. Jones
rjones at redhat.com
Fri May 21 17:21:31 UTC 2010
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
-------------- next part --------------
>From f7c74bdb03ff1f04f4fc33061708c52924546220 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Fri, 21 May 2010 18:20:28 +0100
Subject: [PATCH] Build workaround for Python 2.4.x in RHEL 5.
See:
http://www.python.org/dev/peps/pep-0353/#conversion-guidelines
---
src/generator.ml | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/generator.ml b/src/generator.ml
index d2da8ec..1212a5a 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -9113,6 +9113,12 @@ and generate_python_c () =
#define PY_SSIZE_T_CLEAN 1
#include <Python.h>
+#if PY_VERSION_HEX < 0x02050000
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
--
1.5.5.6
More information about the Libguestfs
mailing list