]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: avoid python 2.4 build failure
authorEric Blake <eblake@redhat.com>
Fri, 24 Jun 2011 04:17:19 +0000 (22:17 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 24 Jun 2011 14:28:56 +0000 (08:28 -0600)
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.

python/typewrappers.h

index 305d594401e23a55b1cd4ef8ab183847fb44089d..70c15d9f9d529234cb4c211e760d9d195349a751 100644 (file)
@@ -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>
  */
 # 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))