summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-06-23 22:17:19 -0600
committerEric Blake <eblake@redhat.com>2011-06-24 08:28:56 -0600
commit18c359e2f9d5b575e72a5b785364c95c9daa648a (patch)
treea58dd4279454e42442ad543cce1ff656bc5945cd
parent76287b51790fe0755752f115acf90648a3ea0fb9 (diff)
downloadlibvirt-python-v6-18c359e2f9d5b575e72a5b785364c95c9daa648a.tar.gz
libvirt-python-v6-18c359e2f9d5b575e72a5b785364c95c9daa648a.tar.xz
libvirt-python-v6-18c359e2f9d5b575e72a5b785364c95c9daa648a.zip
build: avoid python 2.4 build failure
I'm not sure when Py_ssize_t was introduced; but Fedora 14 Python 2.7 has it, while RHEL 5 Python 2.4 lacks it. It should be easy enough to adjust if someone runs into problems. * python/typewrappers.h (Py_ssize_t): Define for older python.
-rw-r--r--typewrappers.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/typewrappers.h b/typewrappers.h
index 305d594..70c15d9 100644
--- a/typewrappers.h
+++ b/typewrappers.h
@@ -1,7 +1,7 @@
/*
* libvirt_wrap.h: type wrappers for libvir python bindings
*
- * Copyright (C) 2005 Red Hat, Inc.
+ * Copyright (C) 2005, 2011 Red Hat, Inc.
*
* Daniel Veillard <veillard@redhat.com>
*/
@@ -21,6 +21,11 @@
# define ATTRIBUTE_UNUSED
#endif
+/* Work around really old python. */
+#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 7
+typedef ssize_t Py_ssize_t;
+#endif
+
#define PyvirConnect_Get(v) (((v) == Py_None) ? NULL : \
(((PyvirConnect_Object *)(v))->obj))