Fix C99 compatibility issue
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
94a33fe996
commit
9ee7c87606
53
gnome-system-monitor-c99.patch
Normal file
53
gnome-system-monitor-c99.patch
Normal file
@ -0,0 +1,53 @@
|
||||
Submitted upstream:
|
||||
|
||||
<https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/merge_requests/67>
|
||||
|
||||
Author: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Mon Feb 6 08:36:22 2023 +0100
|
||||
|
||||
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.
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index a314a684b2a9ceb4..985a361a60b08240 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 2697e892c7463357..71d0b5214b6d15cf 100644
|
||||
--- a/src/legacy/e_date.c
|
||||
+++ b/src/legacy/e_date.c
|
||||
@@ -194,13 +194,6 @@ filter_date (time_t date)
|
||||
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);
|
||||
}
|
@ -5,12 +5,13 @@
|
||||
|
||||
Name: gnome-system-monitor
|
||||
Version: 42.0
|
||||
Release: 3%{?dist}
|
||||
Release: 4%{?dist}
|
||||
Summary: Process and resource monitor
|
||||
|
||||
License: GPLv2+
|
||||
URL: https://wiki.gnome.org/Apps/SystemMonitor
|
||||
Source0: https://download.gnome.org/sources/%{name}/42/%{name}-%{tarball_version}.tar.xz
|
||||
Patch0: gnome-system-monitor-c99.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
@ -68,6 +69,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/gnome-system-monit
|
||||
%{_libexecdir}/gnome-system-monitor/
|
||||
|
||||
%changelog
|
||||
* Mon Feb 06 2023 Florian Weimer <fweimer@redhat.com> - 42.0-4
|
||||
- Fix C99 compatibility issue
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 42.0-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user