From 712e3eb1201315ded996b3f004eb4c613e2cecdd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Apr 2012 20:05:42 +0200 Subject: 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. --- src/glib_compat.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/glib_compat.h') diff --git a/src/glib_compat.h b/src/glib_compat.h index f35576fa3..330c9e779 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 -- cgit v1.2.3