aboutsummaryrefslogtreecommitdiffstats
path: root/src/glib_compat.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-10 21:14:22 +0100
committerMax Kellermann <max@duempel.org>2009-11-10 21:14:22 +0100
commitb722d3d7f365b106794a3f40435ab220098959c5 (patch)
treefc539d0aa20b0357547ced148cc88f18f648d7fe /src/glib_compat.h
parentde57c21a3bec43bffb3fc6a85197f5489e18168f (diff)
downloadmpd-b722d3d7f365b106794a3f40435ab220098959c5.tar.gz
mpd-b722d3d7f365b106794a3f40435ab220098959c5.tar.xz
mpd-b722d3d7f365b106794a3f40435ab220098959c5.zip
configure.ac: require GLib 2.12
Drop the required GLib version from 2.16 to 2.12, because many current systems still don't have GLib 2.16. This requires several new compatibility functions in glib_compat.h.
Diffstat (limited to '')
-rw-r--r--src/glib_compat.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/glib_compat.h b/src/glib_compat.h
index 679307fb3..641fef99a 100644
--- a/src/glib_compat.h
+++ b/src/glib_compat.h
@@ -28,9 +28,28 @@
#include <glib.h>
+#if !GLIB_CHECK_VERSION(2,14,0)
+
+#define g_queue_clear(q) do { g_queue_free(q); q = g_queue_new(); } while (0)
+
+static inline guint
+g_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data)
+{
+ return g_timeout_add(interval * 1000, function, data);
+}
+
+#endif /* !2.14 */
+
#if !GLIB_CHECK_VERSION(2,16,0)
-static char *
+static inline void
+g_propagate_prefixed_error(GError **dest_r, GError *src,
+ G_GNUC_UNUSED const gchar *format, ...)
+{
+ g_propagate_error(dest_r, src);
+}
+
+static inline char *
g_uri_escape_string(const char *unescaped,
G_GNUC_UNUSED const char *reserved_chars_allowed,
G_GNUC_UNUSED gboolean allow_utf8)