aboutsummaryrefslogtreecommitdiff
path: root/include/glib-compat.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-03-23 19:57:24 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-04-06 14:31:43 +0200
commit73dab893b569b0103c28634d7c33575d3602f51f (patch)
tree9b1a3899eff5b5003bbae7317296b38fddb5bafd /include/glib-compat.h
parent6e9396696f869551bc39531aa8220ef813da472e (diff)
error-report: replace deprecated g_get_current_time() with glib >= 2.62
According to GLib API: g_get_current_time has been deprecated since version 2.62 and should not be used in newly-written code. GTimeVal is not year-2038-safe. Use g_get_real_time() instead. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-14-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/glib-compat.h')
-rw-r--r--include/glib-compat.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/glib-compat.h b/include/glib-compat.h
index 3113a7d2af..dc14d3ec0d 100644
--- a/include/glib-compat.h
+++ b/include/glib-compat.h
@@ -145,6 +145,16 @@ qemu_g_test_slow(void)
#define g_test_thorough() qemu_g_test_slow()
#define g_test_quick() (!qemu_g_test_slow())
+#if GLIB_CHECK_VERSION(2,62,0)
+static inline gchar *
+g_date_time_format_iso8601_compat(GDateTime *datetime)
+{
+ return g_date_time_format_iso8601(datetime);
+}
+
+#define g_date_time_format_iso8601 g_date_time_format_iso8601_compat
+#endif
+
#pragma GCC diagnostic pop
#endif