Fix build with recent clang versions

They look for fallthrough annotations but do not support the falltrough
comments that gcc interprets.
This commit is contained in:
Timm Bäder 2020-04-07 14:50:44 +02:00
parent aa4cbd78f7
commit 2aab5a0076
2 changed files with 60 additions and 1 deletions

View File

@ -9,12 +9,13 @@
Name: pango
Version: 1.44.7
Release: 2%{?dist}
Release: 3%{?dist}
Summary: System for layout and rendering of internationalized text
License: LGPLv2+
URL: http://www.pango.org
Source0: https://download.gnome.org/sources/%{name}/1.44/%{name}-%{version}.tar.xz
Patch: replace-fallthrough-comments.patch
BuildRequires: pkgconfig(cairo) >= %{cairo_version}
BuildRequires: pkgconfig(freetype2) >= %{freetype_version}
@ -75,6 +76,7 @@ the functionality of the installed %{name} package.
%prep
%setup -q -n pango-%{version}
%patch0 -p1 -b .fallthrouch-comments
%build
@ -128,6 +130,9 @@ fi
%changelog
* Tue Apr 07 2020 Timm Baeder <tbaeder@redhat.com> - 1.44.7-3
- Add fallthrough-comments.patch to fix build with recent clang versions
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.44.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

View File

@ -0,0 +1,54 @@
diff -ruN pango-1.44.7.orig/pango/break.c pango-1.44.7/pango/break.c
--- pango-1.44.7.orig/pango/break.c 2020-04-07 13:28:18.558848703 +0200
+++ pango-1.44.7/pango/break.c 2020-04-07 14:13:03.555033725 +0200
@@ -405,7 +405,7 @@
GB_type = GB_Prepend;
break;
}
- /* fall through */
+ __attribute__((fallthrough));
case G_UNICODE_CONTROL:
case G_UNICODE_LINE_SEPARATOR:
case G_UNICODE_PARAGRAPH_SEPARATOR:
@@ -421,7 +421,7 @@
GB_type = GB_ControlCRLF;
break;
}
- /* fall through */
+ __attribute__((fallthrough));
case G_UNICODE_OTHER_LETTER:
if (makes_hangul_syllable)
@@ -594,7 +594,7 @@
case G_UNICODE_CONTROL:
if (wc != 0x000D && wc != 0x000A && wc != 0x000B && wc != 0x000C && wc != 0x0085)
break;
- /* fall through */
+ __attribute__((fallthrough));
case G_UNICODE_LINE_SEPARATOR:
case G_UNICODE_PARAGRAPH_SEPARATOR:
WB_type = WB_NewlineCRLF; /* CR, LF, Newline */
diff -ruN pango-1.44.7.orig/pango/pango-renderer.c pango-1.44.7/pango/pango-renderer.c
--- pango-1.44.7.orig/pango/pango-renderer.c 2020-04-07 13:28:18.568848677 +0200
+++ pango-1.44.7/pango/pango-renderer.c 2020-04-07 14:12:53.076064830 +0200
@@ -222,7 +222,7 @@
rect->y + 2 * rect->height,
rect->width,
rect->height);
- /* Fall through */
+ __attribute__((fallthrough));
case PANGO_UNDERLINE_SINGLE:
case PANGO_UNDERLINE_LOW:
pango_renderer_draw_rectangle (renderer,
diff -ruN pango-1.44.7.orig/tests/testboundaries_ucd.c pango-1.44.7/tests/testboundaries_ucd.c
--- pango-1.44.7.orig/tests/testboundaries_ucd.c 2020-04-07 13:28:18.588848625 +0200
+++ pango-1.44.7/tests/testboundaries_ucd.c 2020-04-07 14:16:44.621377237 +0200
@@ -104,7 +104,7 @@
{
case 0x00f7: /* DIVISION SIGN: boundary here */
temp_attr.bits |= bits.bits;
- /* fall through */
+ __attribute__((fallthrough));
case 0x00d7: /* MULTIPLICATION SIGN: no boundary here */
break;