summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2009-11-30 22:01:25 +0100
committerSimon van der Linden <svdlinden@src.gnome.org>2009-11-30 22:03:00 +0100
commite955b931b07113c7432f7a85f882f69f12d263ad (patch)
treec8011185803a74e28f3a15ad6f1f38dd11413dfa
parent542fdf6da4ad8f2d28d0d50152bd93cb4d8ee39a (diff)
downloadpygi-e955b931b07113c7432f7a85f882f69f12d263ad.tar.gz
pygi-e955b931b07113c7432f7a85f882f69f12d263ad.tar.xz
pygi-e955b931b07113c7432f7a85f882f69f12d263ad.zip
Depend on GLib 2.20 rather than 2.22
Backport g_array_get_element_size. https://bugzilla.gnome.org/show_bug.cgi?id=603411
-rw-r--r--configure.ac2
-rw-r--r--gi/pygi-private.h19
2 files changed, 20 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 6658869..33f30e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,7 +36,7 @@ CPPFLAGS="${save_CPPFLAGS}"
# GNOME
PKG_CHECK_MODULES(GNOME,
- glib-2.0 >= 2.22
+ glib-2.0 >= 2.20
gobject-introspection-1.0 >= 0.6.4
pygobject-2.0 >= 2.20
)
diff --git a/gi/pygi-private.h b/gi/pygi-private.h
index 4e2615f..562c8ab 100644
--- a/gi/pygi-private.h
+++ b/gi/pygi-private.h
@@ -43,6 +43,25 @@ G_BEGIN_DECLS
} \
} G_STMT_END
+#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION == 20
+/* Private stuff copied from glib-2.20.x sources */
+struct _GRealArray
+{
+ guint8 *data;
+ guint len;
+ guint alloc;
+ guint elt_size;
+ guint zero_terminated : 1;
+ guint clear : 1;
+};
+
+static inline guint
+g_array_get_element_size (GArray *array)
+{
+ struct _GRealArray *rarray = (struct _GRealArray*) array;
+ return rarray->elt_size;
+}
+#endif
/* Redefine g_array_index because we want it to return the i-th element, casted
* to the type t, of the array a, and not the i-th element of the array a