gnome-system-monitor/gnome-system-monitor-c99.patch
2023-02-16 13:30:25 +00:00

57 lines
1.4 KiB
Diff

From 3be21b4cd1b70e184375061f2d944f6f73e9a3a7 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Mon, 6 Feb 2023 08:36:22 +0100
Subject: [PATCH] meson: Remove unused ctime_r check
It did not work because of an implicit function declaration
(<time.h> does not declare ctime_r due to -std=c11, which disables
GNU extensions). The only use of CTIME_R_THREE_ARGS was #if'ed out,
so remove that as well.
---
meson.build | 10 ----------
src/legacy/e_date.c | 7 -------
2 files changed, 17 deletions(-)
diff --git a/meson.build b/meson.build
index d5d221e3..ab4c7944 100644
--- a/meson.build
+++ b/meson.build
@@ -105,16 +105,6 @@ add_project_arguments(cx.get_supported_arguments(cxxflags),
conf.set('HAVE_LKSTRFTIME', cc.has_function('strftime'))
-conf.set('CTIME_R_THREE_ARGS', cc.compiles('''
-#include <time.h>
-int main() {
- char *buf;
- time_t date;
- ctime_r (&date, buf, 100);
-}
-'''))
-
-
configure_file(
output: 'config.h',
configuration: conf,
diff --git a/src/legacy/e_date.c b/src/legacy/e_date.c
index 19f6d631..2fdaa1c7 100644
--- a/src/legacy/e_date.c
+++ b/src/legacy/e_date.c
@@ -220,13 +220,6 @@ filter_date (time_t date)
else
e_utf8_strftime_fix_am_pm (buf, 26, _("%b %d %Y"), &then);
}
-#if 0
-#ifdef CTIME_R_THREE_ARGS
- ctime_r (&date, buf, 26);
-#else
- ctime_r (&date, buf);
-#endif
-#endif
return g_strdup (buf);
}
--
GitLab