summaryrefslogtreecommitdiffstats
path: root/glib
diff options
context:
space:
mode:
authorJohn Ehresman <jpe@wingware.com>2010-04-12 23:21:24 -0400
committerJohn Ehresman <jpe@wingware.com>2010-04-15 12:13:34 -0400
commitf6f2ed44c84aff3c38fc3eb5961b28621a14fc51 (patch)
tree20d33d2b2dc36a454ba8ad9e59b823b50569e3a8 /glib
parentd8109d9de81a776794965d4cc1093ca03bebd6af (diff)
downloadpygobject-f6f2ed44c84aff3c38fc3eb5961b28621a14fc51.tar.gz
pygobject-f6f2ed44c84aff3c38fc3eb5961b28621a14fc51.tar.xz
pygobject-f6f2ed44c84aff3c38fc3eb5961b28621a14fc51.zip
Make pyglib-python-compat.h a public header and include in pygobject.h Also #define PyVarObject_HEAD_INIT if not defined (in < python 2.6)
Diffstat (limited to 'glib')
-rw-r--r--glib/Makefile.am4
-rw-r--r--glib/pyglib-private.h2
-rw-r--r--glib/pyglib-python-compat.h7
-rw-r--r--glib/pyglib.h2
4 files changed, 12 insertions, 3 deletions
diff --git a/glib/Makefile.am b/glib/Makefile.am
index d230da4..b249332 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -2,7 +2,9 @@ AUTOMAKE_OPTIONS = 1.7
INCLUDES = $(PYTHON_INCLUDES) $(GLIB_CFLAGS) -DPY_SSIZE_T_CLEAN
pkgincludedir = $(includedir)/pygtk-2.0
-pkginclude_HEADERS = pyglib.h
+pkginclude_HEADERS = \
+ pyglib.h \
+ pyglib-python-compat.h
lib_LTLIBRARIES = libpyglib-2.0-@PYTHON_BASENAME@.la
diff --git a/glib/pyglib-private.h b/glib/pyglib-private.h
index 8b033e1..c535fee 100644
--- a/glib/pyglib-private.h
+++ b/glib/pyglib-private.h
@@ -25,8 +25,6 @@
#include <Python.h>
#include <glib.h>
-#include <pyglib-python-compat.h>
-
G_BEGIN_DECLS
struct _PyGLib_Functions {
diff --git a/glib/pyglib-python-compat.h b/glib/pyglib-python-compat.h
index 915a912..c2523ff 100644
--- a/glib/pyglib-python-compat.h
+++ b/glib/pyglib-python-compat.h
@@ -61,6 +61,13 @@ typedef inquiry lenfunc;
#define _PyLong_Type PyInt_Type
#define _PyLong_AS_LONG PyInt_AS_LONG
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
+
+#ifndef PyVarObject_HEAD_INIT
+#define PyVarObject_HEAD_INIT(base, size) \
+ PyObject_HEAD_INIT(base) \
+ size,
+#endif
+
#else
#undef PYGLIB_MODULE_START
#undef PYGLIB_MODULE_END
diff --git a/glib/pyglib.h b/glib/pyglib.h
index 24e1ed2..62561e9 100644
--- a/glib/pyglib.h
+++ b/glib/pyglib.h
@@ -26,6 +26,8 @@
#include <glib.h>
+#include <pyglib-python-compat.h>
+
G_BEGIN_DECLS
typedef void (*PyGLibThreadsEnabledFunc) (void);