From 5259eef42ae9c1baa18210aca02a7c12f15e2882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 17 Jul 2018 10:24:05 +0200 Subject: [PATCH] Fix build conditions in locale.c --- ...locale.c-Fix-conditional-compilation.patch | 56 +++++++++++++++++++ perl.spec | 6 ++ 2 files changed, 62 insertions(+) create mode 100644 perl-5.29.0-locale.c-Fix-conditional-compilation.patch diff --git a/perl-5.29.0-locale.c-Fix-conditional-compilation.patch b/perl-5.29.0-locale.c-Fix-conditional-compilation.patch new file mode 100644 index 0000000..ced6f31 --- /dev/null +++ b/perl-5.29.0-locale.c-Fix-conditional-compilation.patch @@ -0,0 +1,56 @@ +From 17dd77cd74f0a69332c091f816162e34abff30c5 Mon Sep 17 00:00:00 2001 +From: Francois Perrad +Date: Mon, 2 Jul 2018 00:17:44 +0200 +Subject: [PATCH] locale.c: Fix conditional compilation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With Perl 5.28.0, there are some mismatches between blocks +and conditional compilation in the Perl__is_cur_LC_category_utf8() function. +The compilation of miniperl could fails like this: +``` +locale.c: In function `Perl__is_cur_LC_category_utf8`: +locale.c:5481:1: error: expected declaration or statement at end of input + } + ^ +``` + +Signed-off-by: Francois Perrad +Signed-off-by: Petr Písař +--- + locale.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/locale.c b/locale.c +index f8f77fb3d0..f2731846ad 100644 +--- a/locale.c ++++ b/locale.c +@@ -4649,11 +4649,12 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category) + && wc == (wchar_t) UNICODE_REPLACEMENT); + } + ++# endif ++ + restore_switched_locale(LC_CTYPE, original_ctype_locale); + goto finish_and_return; + } + +-# endif + # else + + /* Here, we must have a C89 compiler that doesn't have mbtowc(). Next +@@ -4885,9 +4886,9 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category) + is_utf8 = TRUE; + goto finish_and_return; + } +- } + + # endif ++ } + # endif + + /* Other common encodings are the ISO 8859 series, which aren't UTF-8. But +-- +2.14.4 + diff --git a/perl.spec b/perl.spec index 5fe45ec..30fe57d 100644 --- a/perl.spec +++ b/perl.spec @@ -168,6 +168,9 @@ Patch18: perl-5.29.0-perl.h-Add-parens-around-macro-arguments.patch # RT#133368, in upstream after 5.29.0 Patch19: perl-5.29.0-treat-when-index-1-as-a-boolean-expression.patch +# Fix build conditions in locale.c, in upstream after 5.29.0 +Patch20: perl-5.29.0-locale.c-Fix-conditional-compilation.patch + # Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048 Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch @@ -2741,6 +2744,7 @@ Perl extension for Version Objects %patch17 -p1 %patch18 -p1 %patch19 -p1 +%patch20 -p1 %patch200 -p1 %patch201 -p1 @@ -2767,6 +2771,7 @@ perl -x patchlevel.h \ 'Fedora Patch17: Fix printing a warning about a wide character when matching a regular expression while ISO-8859-1 locale is in effect' \ 'Fedora Patch18: Fix invoking a check for wide characters while ISO-8859-1 locale is in effect' \ 'Fedora Patch19: Fix index() and rindex() optimization in given-when boolean context (RT#133368)' \ + 'Fedora Patch20: Fix build conditions in locale.c' \ 'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \ 'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \ %{nil} @@ -5058,6 +5063,7 @@ popd * Tue Jul 17 2018 Petr Pisar - 4:5.28.0-419 - Fix index() and rindex() optimization in given-when boolean context (RT#133368) +- Fix build conditions in locale.c * Fri Jul 13 2018 Fedora Release Engineering - 4:5.28.0-418 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild