On Mon, Aug 01, 2016 at 11:47:43AM +0200, Michal Privoznik wrote:
Just like libvirt itself is able to work with both major version
of python, libvirt-glib should do the same. Even the code I'm
introducing here is copied from there (and changed slightly to
reflect project name).
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
python/libvirt-glib.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/python/libvirt-glib.c b/python/libvirt-glib.c
index 1daca36..8b3920d 100644
--- a/python/libvirt-glib.c
+++ b/python/libvirt-glib.c
@@ -17,11 +17,19 @@
#include <glib.h>
#include "libvirt-glib/libvirt-glib.h"
+#if PY_MAJOR_VERSION > 2
+# ifndef __CYGWIN__
+extern PyObject *PyInit_libvirtglibmod(void);
+# else
+extern PyObject *PyInit_cygvirtglibmod(void);
+# endif
+#else
#ifndef __CYGWIN__
extern void initlibvirtglibmod(void);
#else
extern void initcygvirtglibmod(void);
#endif
I'd expect this to be re-indented, but make syntax-check doesn't say
anything. Other than that, I have no idea about glib, but the patches
work for me...