summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--test/test-utils-glib.h15
2 files changed, 16 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index dff9ad5d..ce1f2c56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -262,7 +262,7 @@ dnl Don't do anything too subtle here, because the CMake build system
dnl parses these lines with regular expressions. If necessary, adjust
dnl cmake/modules/MacrosAutotools.cmake to compensate.
AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_40], [Ignore post-2.40 deprecations])
-AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_40], [Prevent post-2.40 APIs])
+AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [G_ENCODE_VERSION(2,44)], [Prevent post-2.44 APIs])
with_glib=yes
diff --git a/test/test-utils-glib.h b/test/test-utils-glib.h
index f2f167ca..800a5328 100644
--- a/test/test-utils-glib.h
+++ b/test/test-utils-glib.h
@@ -91,4 +91,19 @@ void test_mkdir (const gchar *path, gint mode);
void test_timeout_reset (void);
+#if !GLIB_CHECK_VERSION(2, 44, 0)
+#define g_steal_pointer(x) backported_g_steal_pointer (x)
+/* A simplified version of g_steal_pointer without type-safety. */
+static inline gpointer
+backported_g_steal_pointer (gpointer pointer_to_pointer)
+{
+ gpointer *pp = pointer_to_pointer;
+ gpointer ret;
+
+ ret = *pp;
+ *pp = NULL;
+ return ret;
+}
+#endif
+
#endif