aboutsummaryrefslogtreecommitdiff
path: root/src/glib_compat.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-04-04 20:05:42 +0200
committerMax Kellermann <max@duempel.org>2012-04-04 20:05:48 +0200
commit712e3eb1201315ded996b3f004eb4c613e2cecdd (patch)
tree1723047b0fd2a94e585347d3598bdcfe26467999 /src/glib_compat.h
parenta2b5db00037bd4e0604643eaa67e7a0dd978bb8a (diff)
input/curl: use g_source_get_time()
g_source_get_current_time() is deprecated since GLib 2.28. This patch adds a compatibility wrapper for older GLib versions to glib_compat.h.
Diffstat (limited to 'src/glib_compat.h')
-rw-r--r--src/glib_compat.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/glib_compat.h b/src/glib_compat.h
index f35576fa..330c9e77 100644
--- a/src/glib_compat.h
+++ b/src/glib_compat.h
@@ -97,4 +97,16 @@ g_set_error_literal(GError **err, GQuark domain, gint code,
#endif
+#if !GLIB_CHECK_VERSION(2,28,0)
+
+static inline gint64
+g_source_get_time(GSource *source)
+{
+ GTimeVal tv;
+ g_source_get_current_time(source, &tv);
+ return tv.tv_sec * 1000000 + tv.tv_usec;
+}
+
+#endif
+
#endif