[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/30] glib-compat: isolate g_date_time_format_iso8601 version-byp
From: |
marcandre . lureau |
Subject: |
[PULL 01/30] glib-compat: isolate g_date_time_format_iso8601 version-bypass |
Date: |
Thu, 21 Apr 2022 17:49:11 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The solution was discussed with Markus Armbruster during the review:
https://patchew.org/QEMU/20220323155743.1585078-1-marcandre.lureau@redhat.com/20220323155743.1585078-14-marcandre.lureau@redhat.com/
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220420132624.2439741-3-marcandre.lureau@redhat.com>
---
include/glib-compat.h | 10 ----------
util/error-report.c | 6 +++++-
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/include/glib-compat.h b/include/glib-compat.h
index dc14d3ec0d1e..3113a7d2af84 100644
--- a/include/glib-compat.h
+++ b/include/glib-compat.h
@@ -145,16 +145,6 @@ 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
diff --git a/util/error-report.c b/util/error-report.c
index d9d3ac30cfab..4ec7b30bcbcc 100644
--- a/util/error-report.c
+++ b/util/error-report.c
@@ -183,9 +183,13 @@ static void print_loc(void)
static char *
real_time_iso8601(void)
{
-#if GLIB_CHECK_VERSION(2, 62, 0)
+#if GLIB_CHECK_VERSION(2,62,0)
g_autoptr(GDateTime) dt = g_date_time_new_from_unix_utc(g_get_real_time());
+ /* ignore deprecation warning, since GLIB_VERSION_MAX_ALLOWED is 2.56 */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
return g_date_time_format_iso8601(dt);
+#pragma GCC diagnostic pop
#else
GTimeVal tv;
g_get_current_time(&tv);
--
2.36.0
- [PULL 00/30] Misc patches, marcandre . lureau, 2022/04/21
- [PULL 01/30] glib-compat: isolate g_date_time_format_iso8601 version-bypass,
marcandre . lureau <=
- [PULL 02/30] scripts/analyze-inclusions: drop qemu-common.h from analysis, marcandre . lureau, 2022/04/21
- [PULL 03/30] Simplify softmmu/main.c, marcandre . lureau, 2022/04/21
- [PULL 05/30] include: rename qemu-common.h qemu/help-texts.h, marcandre . lureau, 2022/04/21
- [PULL 04/30] hw/hyperv: remove needless qemu-common.h include, marcandre . lureau, 2022/04/21
- [PULL 06/30] qga: replace usleep() with g_usleep(), marcandre . lureau, 2022/04/21
- [PULL 08/30] arm/digic: replace snprintf() with g_strdup_printf(), marcandre . lureau, 2022/04/21
- [PULL 07/30] docs: trace-events-all is installed without renaming, marcandre . lureau, 2022/04/21
- [PULL 09/30] arm/allwinner-a10: replace snprintf() with g_strdup_printf(), marcandre . lureau, 2022/04/21
- [PULL 10/30] intc/exynos4210_gic: replace snprintf() with g_strdup_printf(), marcandre . lureau, 2022/04/21
- [PULL 11/30] doc/style: CLang -> Clang, marcandre . lureau, 2022/04/21