diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2013-05-14 14:16:46 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2013-05-14 14:40:02 +0200 |
commit | 90d3f3aac8080077064de54f571dce2f859d9788 (patch) | |
tree | d0ea75c9c05d5dffb06a5555ef04be6ae6c6e8e8 | |
parent | 1d9a42427b39ed454f3e94553d790140cc8bc0ba (diff) |
Fix glib2 2.22 build after edf1daf5
channel-display.c: In function 'display_update_stream_report':
channel-display.c:1273: warning: implicit declaration of function
'g_get_monotonic_time'
-rw-r--r-- | gtk/glib-compat.c | 11 | ||||
-rw-r--r-- | gtk/glib-compat.h | 4 | ||||
-rw-r--r-- | gtk/spice-session.c | 12 |
3 files changed, 15 insertions, 12 deletions
diff --git a/gtk/glib-compat.c b/gtk/glib-compat.c index 0c108ef..21be1f6 100644 --- a/gtk/glib-compat.c +++ b/gtk/glib-compat.c @@ -101,3 +101,14 @@ g_slist_free_full(GSList *list, G_DEFINE_BOXED_TYPE (GMainContext, spice_main_context, g_main_context_ref, g_main_context_unref) #endif +#if !GLIB_CHECK_VERSION(2,27,2) +guint64 g_get_monotonic_time(void) +{ + GTimeVal tv; + + /* TODO: support real monotonic clock? */ + g_get_current_time(&tv); + + return (((gint64) tv.tv_sec) * 1000000) + tv.tv_usec; +} +#endif diff --git a/gtk/glib-compat.h b/gtk/glib-compat.h index cc5232a..c30a735 100644 --- a/gtk/glib-compat.h +++ b/gtk/glib-compat.h @@ -129,4 +129,8 @@ GType spice_main_context_get_type (void) G_GNUC_CONST; } G_STMT_END #endif +#if !GLIB_CHECK_VERSION(2,27,2) +guint64 g_get_monotonic_time(void); +#endif + #endif /* GLIB_COMPAT_H */ diff --git a/gtk/spice-session.c b/gtk/spice-session.c index 8a612cf..8cb2d39 100644 --- a/gtk/spice-session.c +++ b/gtk/spice-session.c @@ -1969,18 +1969,6 @@ int spice_session_get_connection_id(SpiceSession *session) return s->connection_id; } -#if !GLIB_CHECK_VERSION(2,27,2) -static guint64 g_get_monotonic_time(void) -{ - GTimeVal tv; - - /* TODO: support real monotonic clock? */ - g_get_current_time(&tv); - - return (((gint64) tv.tv_sec) * 1000000) + tv.tv_usec; -} -#endif - G_GNUC_INTERNAL guint32 spice_session_get_mm_time(SpiceSession *session) { |