C compatibility fix for the configure script (#2252276)

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
Florian Weimer 2023-11-30 15:56:59 +01:00
parent 188062b89f
commit ed0fb27512
2 changed files with 31 additions and 1 deletions

26
units-configure-c99.patch Normal file
View File

@ -0,0 +1,26 @@
diff --git a/configure b/configure
index 22c75a6222b06f68..43461d54e59f1568 100755
--- a/configure
+++ b/configure
@@ -3881,7 +3881,7 @@ else
int
main ()
{
-wchar_t *out;char *in;char *res;
+wchar_t *out;char *in;const char *res;
res=setlocale(LC_CTYPE,"");res=in;
mbsrtowcs(out, &res, 2, NULL);
wcswidth(out,2);
diff --git a/configure.ac b/configure.ac
index c728d5c15d16ab2e..cd39f96e39f7d587 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,7 +121,7 @@ AC_CACHE_CHECK([for locale and UTF-8 support], am_cv_utf8,
#include <wchar.h>
#include <locale.h>
#include <langinfo.h>
-], [wchar_t *out;char *in;char *res;
+], [wchar_t *out;char *in;const char *res;
res=setlocale(LC_CTYPE,"");res=in;
mbsrtowcs(out, &res, 2, NULL);
wcswidth(out,2);],

View File

@ -1,7 +1,7 @@
Summary: A utility for converting amounts from one unit to another
Name: units
Version: 2.22
Release: 6%{?dist}
Release: 7%{?dist}
Source: https://ftp.gnu.org/gnu/units/%{name}-%{version}.tar.gz
URL: https://www.gnu.org/software/units/units.html
License: GPL-3.0-or-later
@ -14,6 +14,7 @@ BuildRequires: readline-devel
# do not update currency.units from network during build
Patch1: 0001-units-2.22-no-network.patch
Patch2: units-configure-c99.patch
%description
Units converts an amount from one unit to another, or tells you what
@ -52,6 +53,9 @@ make check
%{_mandir}/man1/*
%changelog
* Thu Nov 30 2023 Florian Weimer <fweimer@redhat.com> - 2.22-7
- C compatibility fix for the configure script (#2252276)
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.22-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild