|
|
6413ff |
From cade7a759cfd98922de0bb96bfb29721d861e25e Mon Sep 17 00:00:00 2001
|
|
|
6413ff |
From: Lubomir Rintel <lkundrak@v3.sk>
|
|
|
6413ff |
Date: Tue, 13 Dec 2022 18:14:51 +0100
|
|
|
6413ff |
Subject: [PATCH] libmm-glib,common-helpers: avoid using mm_new_iso8601_time()
|
|
|
6413ff |
MIME-Version: 1.0
|
|
|
6413ff |
Content-Type: text/plain; charset=UTF-8
|
|
|
6413ff |
Content-Transfer-Encoding: 8bit
|
|
|
6413ff |
|
|
|
6413ff |
It requires newer glib than we do:
|
|
|
6413ff |
|
|
|
6413ff |
../libmm-glib/mm-common-helpers.c: In function ‘mm_new_iso8601_time’:
|
|
|
6413ff |
../libmm-glib/mm-common-helpers.c:1787:9: warning: ‘g_time_zone_new_offset’ is deprecated: Not available before 2.58 [-Wdeprecated-declarations]
|
|
|
6413ff |
1787 | tz = g_time_zone_new_offset (offset_minutes * 60);
|
|
|
6413ff |
| ^~
|
|
|
6413ff |
In file included from /usr/include/glib-2.0/glib/gdatetime.h:33:
|
|
|
6413ff |
/usr/include/glib-2.0/glib/gtimezone.h:67:25: note: declared here
|
|
|
6413ff |
67 | GTimeZone * g_time_zone_new_offset (gint32 seconds);
|
|
|
6413ff |
| ^~~~~~~~~~~~~~~~~~~~~~
|
|
|
6413ff |
|
|
|
6413ff |
Let's not use the routine as opposed to bumping our requirement so that
|
|
|
6413ff |
we don't lose ability to build on CentOS 8.
|
|
|
6413ff |
---
|
|
|
6413ff |
libmm-glib/mm-common-helpers.c | 8 +++++++-
|
|
|
6413ff |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
6413ff |
|
|
|
6413ff |
diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c
|
|
|
6413ff |
index de49136d..91371e96 100644
|
|
|
6413ff |
--- a/libmm-glib/mm-common-helpers.c
|
|
|
6413ff |
+++ b/libmm-glib/mm-common-helpers.c
|
|
|
6413ff |
@@ -1783,8 +1783,14 @@ mm_new_iso8601_time (guint year,
|
|
|
6413ff |
|
|
|
6413ff |
if (have_offset) {
|
|
|
6413ff |
g_autoptr(GTimeZone) tz = NULL;
|
|
|
6413ff |
+ g_autofree gchar *identifier = NULL;
|
|
|
6413ff |
|
|
|
6413ff |
- tz = g_time_zone_new_offset (offset_minutes * 60);
|
|
|
6413ff |
+ identifier = g_strdup_printf ("%c%02u:%02u:00",
|
|
|
6413ff |
+ (offset_minutes >= 0) ? '+' : '-',
|
|
|
6413ff |
+ ABS (offset_minutes) / 60,
|
|
|
6413ff |
+ ABS (offset_minutes) % 60);
|
|
|
6413ff |
+
|
|
|
6413ff |
+ tz = g_time_zone_new (identifier);
|
|
|
6413ff |
dt = g_date_time_new (tz, year, month, day, hour, minute, second);
|
|
|
6413ff |
} else
|
|
|
6413ff |
dt = g_date_time_new_utc (year, month, day, hour, minute, second);
|
|
|
6413ff |
--
|
|
|
6413ff |
2.38.1
|
|
|
6413ff |
|