From 519c6069234311a16929dd9a63570e15605c0379 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 9 Feb 2013 15:18:35 +0100 Subject: [PATCH] g_get_real_time appeard in 2.28 --- glib-compat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/glib-compat.h b/glib-compat.h index c76ccca..d13e59f 100644 --- a/glib-compat.h +++ b/glib-compat.h @@ -20,4 +20,14 @@ #define mutex_free(m) g_mutex_clear((m)) #endif +/* g_get_real_time appeared in 2.28 */ +#if !GLIB_CHECK_VERSION(2, 27, 0) +inline static gint64 g_get_real_time(void) +{ + GTimeVal tv; + g_get_current_time(&tv); + return (((gint64) tv.tv_sec) * 1000000) + tv.tv_usec; +} +#endif + #endif