diff options
Diffstat (limited to 'src/glib_compat.h')
-rw-r--r-- | src/glib_compat.h | 12 |
1 files changed, 12 insertions, 0 deletions
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 |