diff options
Diffstat (limited to 'src/glib_compat.h')
-rw-r--r-- | src/glib_compat.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/glib_compat.h b/src/glib_compat.h index 4d0e7040d..8307997d5 100644 --- a/src/glib_compat.h +++ b/src/glib_compat.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2010 The Music Player Daemon Project + * Copyright (C) 2003-2011 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -32,6 +32,12 @@ #define g_queue_clear(q) do { g_queue_free(q); q = g_queue_new(); } while (0) +static inline GSource * +g_timeout_source_new_seconds(guint interval) +{ + return g_timeout_source_new(interval * 1000); +} + static inline guint g_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data) { @@ -74,4 +80,15 @@ g_uri_parse_scheme(const char *uri) #endif +#if !GLIB_CHECK_VERSION(2,18,0) + +static inline void +g_set_error_literal(GError **err, GQuark domain, gint code, + const gchar *message) +{ + g_set_error(err, domain, code, "%s", message); +} + +#endif + #endif |