summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-bg.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-02-03 23:09:51 +0100
committerraveit65 <[email protected]>2020-02-16 13:55:25 +0100
commite8fbac2ce193f5c2c93fdecb7ca0e14c1152ace6 (patch)
treef352830733cbf6ccf755a5cbe98d68ce9d4b3889 /libmate-desktop/mate-bg.c
parent2edc2a7dfbf95cf710002d633ca11530ef094ce8 (diff)
downloadmate-desktop-e8fbac2ce193f5c2c93fdecb7ca0e14c1152ace6.tar.bz2
mate-desktop-e8fbac2ce193f5c2c93fdecb7ca0e14c1152ace6.tar.xz
Remove GTimeVal deprecation warning for GLib 2.61.2+
Diffstat (limited to 'libmate-desktop/mate-bg.c')
-rw-r--r--libmate-desktop/mate-bg.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index 3ced320..d8a20c8 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -1709,15 +1709,29 @@ struct _SlideShow
};
+#if GLIB_CHECK_VERSION(2,61,2)
static double
now (void)
{
+ const double microseconds_per_second = (double) G_USEC_PER_SEC;
+ gint64 tv;
+
+ tv = g_get_real_time ();
+
+ return (double) (tv / microseconds_per_second);
+}
+#else
+static double
+now (void)
+{
+ const double microseconds_per_second = (double) G_USEC_PER_SEC;
GTimeVal tv;
g_get_current_time (&tv);
- return (double)tv.tv_sec + (tv.tv_usec / 1000000.0);
+ return (double)tv.tv_sec + (tv.tv_usec / microseconds_per_second);
}
+#endif
static Slide *
get_current_slide (SlideShow *show,