Skip to content

Commit dafa216

Browse files
committed
Fix access violation on Windows 10 IoT + more
- MinGW-w64 CRT needs to be linked with LLD. - Build and bundle llvm-mingw tests. - Compile gettext with --disable-libasprintf. - Update LLVM to 10.0.0. - Update MinGW-w64 to the latest master version. - Build Rust within MXE instead of using the Rust Docker image. - Fix librsvg build with latest MinGW-w64.
1 parent b89095b commit dafa216

33 files changed

+541
-202
lines changed

8.9/build.sh

+7
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ make meson-wrapper gendef vips-$deps \
8383
MXE_PLUGIN_DIRS="$plugins" \
8484
MXE_TARGETS=$target.$deps
8585

86+
# Build and bundle llvm-mingw tests
87+
if [ "$LLVM" = "true" ]; then
88+
make test-llvm-mingw \
89+
MXE_PLUGIN_DIRS="$plugins" \
90+
MXE_TARGETS=$target.$deps
91+
fi
92+
8693
cd $work_dir
8794

8895
# Packaging

8.9/overrides.mk

+55-44
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ mingw-w64-headers_CONFIGURE_OPTS=--prefix='$(PREFIX)/$(TARGET)/mingw'
1010
common_CONFIGURE_OPTS=--prefix='$(PREFIX)/$(TARGET)/mingw' \
1111
--with-sysroot='$(PREFIX)/$(TARGET)/mingw' \
1212
CPPFLAGS='-I$(PREFIX)/$(TARGET)/mingw/include' \
13-
CFLAGS='-I$(PREFIX)/$(TARGET)/mingw/include' \
14-
CXXFLAGS='-I$(PREFIX)/$(TARGET)/mingw/include' \
13+
CFLAGS='-I$(PREFIX)/$(TARGET)/mingw/include -s -O3 -ffast-math' \
14+
CXXFLAGS='-I$(PREFIX)/$(TARGET)/mingw/include -s -O3 -ffast-math' \
1515
LDFLAGS='-L$(PREFIX)/$(TARGET)/mingw/lib' \
1616
RCFLAGS='-I$(PREFIX)/$(TARGET)/mingw/include'
1717

@@ -48,36 +48,32 @@ define gcc_BUILD_i686-w64-mingw32
4848
ln -sf '$(PREFIX)/$(TARGET)/mingw/include/'* '$(PREFIX)/$(TARGET)/include'
4949
endef
5050

51-
# GCC does not support Windows on ARM
52-
gcc_BUILD_armv7-w64-mingw32 =
53-
gcc_BUILD_aarch64-w64-mingw32 =
54-
5551
define llvm-mingw_BUILD_x86_64-w64-mingw32
56-
$(subst # install the usual wrappers, ln -sf $(PREFIX)/$(TARGET)/mingw/bin/* $(PREFIX)/$(TARGET)/bin && \
57-
ln -sf '$(PREFIX)/$(TARGET)/mingw/lib/'* '$(PREFIX)/$(TARGET)/lib' && \
58-
ln -sf '$(PREFIX)/$(TARGET)/mingw/include/'* '$(PREFIX)/$(TARGET)/include', \
59-
$(subst @mingw-crt-config-opts@,--disable-lib32 --enable-lib64 $(common_CONFIGURE_OPTS), $(llvm-mingw_BUILD_mingw-w64)))
52+
$(subst @mingw-crt-config-opts@,--disable-lib32 --enable-lib64 $(common_CONFIGURE_OPTS),$(llvm-mingw_BUILD_mingw-w64))
53+
ln -sf '$(PREFIX)/$(TARGET)/mingw/bin/'* '$(PREFIX)/$(TARGET)/bin'
54+
ln -sf '$(PREFIX)/$(TARGET)/mingw/lib/'* '$(PREFIX)/$(TARGET)/lib'
55+
ln -sf '$(PREFIX)/$(TARGET)/mingw/include/'* '$(PREFIX)/$(TARGET)/include'
6056
endef
6157

6258
define llvm-mingw_BUILD_i686-w64-mingw32
63-
$(subst # install the usual wrappers, ln -sf $(PREFIX)/$(TARGET)/mingw/bin/* $(PREFIX)/$(TARGET)/bin && \
64-
ln -sf '$(PREFIX)/$(TARGET)/mingw/lib/'* '$(PREFIX)/$(TARGET)/lib' && \
65-
ln -sf '$(PREFIX)/$(TARGET)/mingw/include/'* '$(PREFIX)/$(TARGET)/include', \
66-
$(subst @mingw-crt-config-opts@,--enable-lib32 --disable-lib64 $(common_CONFIGURE_OPTS), $(llvm-mingw_BUILD_mingw-w64)))
59+
$(subst @mingw-crt-config-opts@,--enable-lib32 --disable-lib64 $(common_CONFIGURE_OPTS),$(llvm-mingw_BUILD_mingw-w64))
60+
ln -sf '$(PREFIX)/$(TARGET)/mingw/bin/'* '$(PREFIX)/$(TARGET)/bin'
61+
ln -sf '$(PREFIX)/$(TARGET)/mingw/lib/'* '$(PREFIX)/$(TARGET)/lib'
62+
ln -sf '$(PREFIX)/$(TARGET)/mingw/include/'* '$(PREFIX)/$(TARGET)/include'
6763
endef
6864

6965
define llvm-mingw_BUILD_armv7-w64-mingw32
70-
$(subst # install the usual wrappers, ln -sf $(PREFIX)/$(TARGET)/mingw/bin/* $(PREFIX)/$(TARGET)/bin && \
71-
ln -sf '$(PREFIX)/$(TARGET)/mingw/lib/'* '$(PREFIX)/$(TARGET)/lib' && \
72-
ln -sf '$(PREFIX)/$(TARGET)/mingw/include/'* '$(PREFIX)/$(TARGET)/include', \
73-
$(subst @mingw-crt-config-opts@,--disable-lib32 --disable-lib64 --enable-libarm32 $(common_CONFIGURE_OPTS), $(llvm-mingw_BUILD_mingw-w64)))
66+
$(subst @mingw-crt-config-opts@,--disable-lib32 --disable-lib64 --enable-libarm32 $(common_CONFIGURE_OPTS),$(llvm-mingw_BUILD_mingw-w64))
67+
ln -sf '$(PREFIX)/$(TARGET)/mingw/bin/'* '$(PREFIX)/$(TARGET)/bin'
68+
ln -sf '$(PREFIX)/$(TARGET)/mingw/lib/'* '$(PREFIX)/$(TARGET)/lib'
69+
ln -sf '$(PREFIX)/$(TARGET)/mingw/include/'* '$(PREFIX)/$(TARGET)/include'
7470
endef
7571

7672
define llvm-mingw_BUILD_aarch64-w64-mingw32
77-
$(subst # install the usual wrappers, ln -sf $(PREFIX)/$(TARGET)/mingw/bin/* $(PREFIX)/$(TARGET)/bin && \
78-
ln -sf '$(PREFIX)/$(TARGET)/mingw/lib/'* '$(PREFIX)/$(TARGET)/lib' && \
79-
ln -sf '$(PREFIX)/$(TARGET)/mingw/include/'* '$(PREFIX)/$(TARGET)/include', \
80-
$(subst @mingw-crt-config-opts@,--disable-lib32 --disable-lib64 --enable-libarm64 $(common_CONFIGURE_OPTS), $(llvm-mingw_BUILD_mingw-w64)))
73+
$(subst @mingw-crt-config-opts@,--disable-lib32 --disable-lib64 --enable-libarm64 $(common_CONFIGURE_OPTS),$(llvm-mingw_BUILD_mingw-w64))
74+
ln -sf '$(PREFIX)/$(TARGET)/mingw/bin/'* '$(PREFIX)/$(TARGET)/bin'
75+
ln -sf '$(PREFIX)/$(TARGET)/mingw/lib/'* '$(PREFIX)/$(TARGET)/lib'
76+
ln -sf '$(PREFIX)/$(TARGET)/mingw/include/'* '$(PREFIX)/$(TARGET)/include'
8177
endef
8278

8379
## Update dependencies
@@ -280,7 +276,7 @@ zlib_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST))
280276
# Added: mingw-std-threads, libjpeg-turbo, lcms
281277
# librsvg:
282278
# Removed: libcroco, libgsf
283-
# Added: libxml2
279+
# Added: libxml2, rust
284280
# libwebp:
285281
# Added: gettext
286282
# Cairo:
@@ -304,22 +300,36 @@ openexr_DEPS := cc ilmbase zlib $(BUILD)~cmake
304300
ilmbase_DEPS := cc $(BUILD)~cmake
305301
pango_DEPS := $(pango_DEPS) fribidi
306302
poppler_DEPS := cc mingw-std-threads cairo libjpeg-turbo freetype glib openjpeg lcms libpng tiff zlib
307-
librsvg_DEPS := cc cairo gdk-pixbuf glib pango libxml2
303+
librsvg_DEPS := $(filter-out libcroco libgsf ,$(librsvg_DEPS)) libxml2 rust
308304
libwebp_DEPS := $(libwebp_DEPS) gettext
309305
cairo_DEPS := cc fontconfig freetype-bootstrap glib libpng pixman
310-
hdf5_DEPS := cc zlib $(BUILD)~cmake
311-
x265_DEPS := cc $(BUILD)~nasm
306+
hdf5_DEPS := $(filter-out pthreads ,$(hdf5_DEPS)) $(BUILD)~cmake
307+
x265_DEPS := $(subst yasm,$(BUILD)~nasm,$(x265_DEPS))
312308

313309
## Override build scripts
314310

311+
# libasprintf isn't needed, so build with --disable-libasprintf
312+
define gettext_BUILD
313+
cd '$(SOURCE_DIR)' && autoreconf -fi
314+
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/gettext-runtime/configure' \
315+
$(MXE_CONFIGURE_OPTS) \
316+
--enable-threads=win32 \
317+
--without-libexpat-prefix \
318+
--without-libxml2-prefix \
319+
--disable-libasprintf \
320+
CONFIG_SHELL=$(SHELL)
321+
$(MAKE) -C '$(BUILD_DIR)/intl' -j '$(JOBS)'
322+
$(MAKE) -C '$(BUILD_DIR)/intl' -j 1 install
323+
endef
324+
315325
# disable version script on llvm-mingw
316326
define libffi_BUILD
317327
# build and install the library
318328
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
319329
$(MXE_CONFIGURE_OPTS) \
320330
--disable-multi-os-directory \
321331
$(if $(BUILD_STATIC), --disable-raw-api) \
322-
$(if $(findstring posix,$(TARGET)), --disable-symvers)
332+
$(if $(IS_LLVM), --disable-symvers)
323333

324334
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
325335
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
@@ -457,23 +467,14 @@ define lcms_BUILD
457467
$(MAKE) -C '$(BUILD_DIR)' -j 1 install $(MXE_DISABLE_PROGRAMS)
458468
endef
459469

460-
define imagemagick_REVISION
461-
$(SED) -n 's/MAGICK_GIT_REVISION=\(.*\)/\1/p' $(SOURCE_DIR)/configure
462-
endef
463-
464470
# disable largefile support, we rely on vips for that and ImageMagick's
465471
# detection does not work when cross-compiling
466472
# build with jpeg-turbo and without lzma
467473
# disable POSIX threads with --without-threads, use Win32 threads instead
468474
# exclude deprecated methods in MagickCore API
469475
define imagemagick_BUILD
470-
$(SED) -i "s|\(\[MAGICK_GIT_REVISION\],\).*\]|\1['$(shell $(imagemagick_REVISION))']|" $(SOURCE_DIR)/configure.ac
471-
472476
# avoid linking against -lgdi32, see: https://github.com/kleisauke/net-vips/issues/61
473-
$(SED) -i 's,-lgdi32,,g' $(SOURCE_DIR)/configure.ac
474-
475-
# need to regenerate the configure script
476-
cd '$(SOURCE_DIR)' && autoreconf -fi
477+
$(SED) -i 's,-lgdi32,,g' $(SOURCE_DIR)/configure
477478

478479
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
479480
$(MXE_CONFIGURE_OPTS) \
@@ -536,22 +537,32 @@ endef
536537

537538
# compile with the Rust toolchain
538539
define librsvg_BUILD
540+
# We need to explicitly link against msvcrt-os after commit ae95d7c
541+
# on the mingw-w64 repo. Otherwise the __ms_vsnprintf symbol is
542+
# undefined during linking. The standard library of Rust appears
543+
# to link against this symbol by default.
544+
# Note: this can probably be removed when the standard library of
545+
# Rust is build with the latest mingw-w64 version (> v7.0.0).
546+
# TODO: Could we use this instead?:
547+
# LDFLAGS='$(LDFLAGS) -Wl,-u,___mingw_vsnprintf -Wl,--defsym,___ms_vsnprintf=___mingw_vsnprintf'
548+
$(if $(IS_LLVM), \
549+
$(SED) -i 's/^\(Libs:.*\)/\1 -lmsvcrt-os/' '$(SOURCE_DIR)/librsvg.pc.in')
550+
539551
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
540552
$(MXE_CONFIGURE_OPTS) \
541553
--disable-pixbuf-loader \
542554
--disable-gtk-doc \
543555
--disable-introspection \
544556
--disable-tools \
545-
RUST_TARGET=$(firstword $(subst -, ,$(TARGET)))-pc-windows-gnu
557+
RUST_TARGET='$(PROCESSOR)-pc-windows-gnu' \
558+
CARGO='$(TARGET)-cargo' \
559+
RUSTC='$(TARGET)-rustc' \
560+
$(if $(IS_LLVM), LIBS='-lmsvcrt-os -lucrt')
546561

547562
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
548563
$(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_LIB)
549564
endef
550565

551-
# TODO: Rust MinGW-w64 ARM/ARM64 targets are not yet supported
552-
librsvg_BUILD_armv7-w64-mingw32 =
553-
librsvg_BUILD_aarch64-w64-mingw32 =
554-
555566
# compile with CMake and with libjpeg-turbo
556567
define poppler_BUILD
557568
$(if $(findstring win32,$(TARGET)),\
@@ -707,7 +718,7 @@ define libxml2_BUILD
707718
--without-debug \
708719
--without-python \
709720
--without-threads \
710-
$(if $(findstring posix,$(TARGET)), --disable-ld-version-script)
721+
$(if $(IS_LLVM), --disable-ld-version-script)
711722
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_CRUFT)
712723
$(MAKE) -C '$(BUILD_DIR)' -j 1 install $(MXE_DISABLE_CRUFT)
713724
ln -sf '$(PREFIX)/$(TARGET)/bin/xml2-config' '$(PREFIX)/bin/$(TARGET)-xml2-config'
@@ -849,7 +860,7 @@ define hdf5_BUILD
849860
-DH5_LLONG_TO_LDOUBLE_CORRECT=ON \
850861
-DH5_DISABLE_SOME_LDOUBLE_CONV=OFF \
851862
-DH5_NO_ALIGNMENT_RESTRICTIONS=ON \
852-
-DH5_HAVE_IOEO=$(if $(findstring posix,$(TARGET)),1,0) \
863+
-DH5_HAVE_IOEO=$(if $(IS_LLVM),1,0) \
853864
-DTEST_LFS_WORKS_RUN=0 \
854865
-DHDF5_ENABLE_THREADSAFE=ON \
855866
-DHDF5_USE_PREGEN=ON \

8.9/package-vipsdev.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ echo "Generating import files"
8282
echo "Cleaning unnecessary files / directories"
8383

8484
# TODO Do we need to keep /share/doc and /share/gtk-doc?
85-
rm -rf $repackage_dir/share/{aclocal,bash-completion,clang,cmake,config.site,doc,gdb,glib-2.0,gtk-2.0,gtk-doc,installed-tests,man,meson,opt-viewer,scan-build,scan-view,thumbnailers,xml}
85+
rm -rf $repackage_dir/share/{aclocal,bash-completion,clang,cmake,config.site,doc,gdb,glib-2.0,gtk-2.0,gtk-doc,installed-tests,man,meson,opt-viewer,scan-build,scan-view,thumbnailers,xml,zsh}
8686
rm -rf $repackage_dir/include/{cairo,clang-c,c++,llvm-c}
87-
rm -rf $repackage_dir/lib/{*.so*,*cairo*,*gdk*,clang,ldscripts}
87+
rm -rf $repackage_dir/lib/{*.so*,*cairo*,*gdk*,clang,ldscripts,rustlib}
88+
rm -rf $repackage_dir/etc/bash_completion.d
8889

8990
find $repackage_dir/lib -name "*.la" -exec rm -f {} \;
9091

8.9/patches/cairo-1-fixes.patch

+23-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Contains ad hoc patches for cross building.
55
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
66
From: Bryce Harrington <[email protected]>
77
Date: Sun, 3 Mar 2019 00:01:34 -0800
8-
Subject: [PATCH 1/3] Revert "clip-boxes: Drop too-early return"
8+
Subject: [PATCH 1/4] Revert "clip-boxes: Drop too-early return"
99

1010
This reverts commit cb871c6c692af68d8e0bf9e26472af45435f8a2c.
1111

@@ -30,7 +30,7 @@ index 1111111..2222222 100644
3030
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
3131
From: Kleis Auke Wolthuizen <[email protected]>
3232
Date: Mon, 25 Nov 2019 15:30:00 +0100
33-
Subject: [PATCH 2/3] Remove -D_FORTIFY_SOURCE=2 flag
33+
Subject: [PATCH 2/4] Remove -D_FORTIFY_SOURCE=2 flag
3434

3535
See:
3636
https://github.com/msys2/MINGW-packages/issues/5803
@@ -54,7 +54,7 @@ index 1111111..2222222 100644
5454
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5555
From: Kleis Auke Wolthuizen <[email protected]>
5656
Date: Wed, 12 Feb 2020 20:00:00 +0100
57-
Subject: [PATCH 3/3] Always define _cairo_utf8_to_utf16 on Windows
57+
Subject: [PATCH 3/4] Always define _cairo_utf8_to_utf16 on Windows
5858

5959
_cairo_utf8_to_utf16 is used by _cairo_fopen on Windows so it must
6060
be defined even if Win32 fonts or other features are disabled.
@@ -72,3 +72,23 @@ index 1111111..2222222 100644
7272
# define CAIRO_HAS_UTF8_TO_UTF16 1
7373
#endif
7474
#if CAIRO_HAS_UTF8_TO_UTF16
75+
76+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
77+
From: Kleis Auke Wolthuizen <[email protected]>
78+
Date: Fri, 20 Mar 2020 13:00:00 +0100
79+
Subject: [PATCH 4/4] Avoid mapping platform-specific functions on MinGW
80+
81+
82+
diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h
83+
index 1111111..2222222 100644
84+
--- a/src/cairo-compiler-private.h
85+
+++ b/src/cairo-compiler-private.h
86+
@@ -195,7 +195,7 @@
87+
#define __attribute__(x)
88+
#endif
89+
90+
-#if (defined(__WIN32__) && !defined(__WINE__)) || defined(_MSC_VER)
91+
+#if (defined(__WIN32__) && !defined(__WINE__) && !defined(__MINGW32__)) || defined(_MSC_VER)
92+
#define access _access
93+
#define fdopen _fdopen
94+
#define hypot _hypot

8.9/patches/pango-1-fixes.patch

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
This file is part of MXE. See LICENSE.md for licensing information.
2+
3+
Contains ad hoc patches for cross building.
4+
5+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
6+
From: Kleis Auke Wolthuizen <[email protected]>
7+
Date: Tue, 24 Mar 2020 18:42:57 +0100
8+
Subject: [PATCH 1/1] Properly define fallthrough
9+
10+
Fixes build with LLVM 10.
11+
12+
(Perhaps Pango should not be compiled with -Werror?)
13+
14+
diff --git a/pango/break.c b/pango/break.c
15+
index 1111111..2222222 100644
16+
--- a/pango/break.c
17+
+++ b/pango/break.c
18+
@@ -31,6 +31,16 @@
19+
#define PARAGRAPH_SEPARATOR 0x2029
20+
#define PARAGRAPH_SEPARATOR_STRING "\xE2\x80\xA9"
21+
22+
+#ifndef __has_attribute
23+
+#define __has_attribute(x) 0
24+
+#endif
25+
+
26+
+#if __has_attribute(__fallthrough__)
27+
+# define FALL_THROUGH __attribute__ ((fallthrough))
28+
+#else
29+
+# define FALL_THROUGH ((void)0) /* fall through */
30+
+#endif
31+
+
32+
/* See http://www.unicode.org/unicode/reports/tr14/ if you hope
33+
* to understand the line breaking code.
34+
*/
35+
@@ -405,7 +415,7 @@ pango_default_break (const gchar *text,
36+
GB_type = GB_Prepend;
37+
break;
38+
}
39+
- /* fall through */
40+
+ FALL_THROUGH;
41+
case G_UNICODE_CONTROL:
42+
case G_UNICODE_LINE_SEPARATOR:
43+
case G_UNICODE_PARAGRAPH_SEPARATOR:
44+
@@ -421,7 +431,7 @@ pango_default_break (const gchar *text,
45+
GB_type = GB_ControlCRLF;
46+
break;
47+
}
48+
- /* fall through */
49+
+ FALL_THROUGH;
50+
51+
case G_UNICODE_OTHER_LETTER:
52+
if (makes_hangul_syllable)
53+
@@ -594,7 +604,7 @@ pango_default_break (const gchar *text,
54+
case G_UNICODE_CONTROL:
55+
if (wc != 0x000D && wc != 0x000A && wc != 0x000B && wc != 0x000C && wc != 0x0085)
56+
break;
57+
- /* fall through */
58+
+ FALL_THROUGH;
59+
case G_UNICODE_LINE_SEPARATOR:
60+
case G_UNICODE_PARAGRAPH_SEPARATOR:
61+
WB_type = WB_NewlineCRLF; /* CR, LF, Newline */
62+
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
63+
index 1111111..2222222 100644
64+
--- a/pango/pango-renderer.c
65+
+++ b/pango/pango-renderer.c
66+
@@ -31,6 +31,16 @@
67+
#define PANGO_IS_RENDERER_FAST(renderer) (renderer != NULL)
68+
#define IS_VALID_PART(part) ((guint)part < N_RENDER_PARTS)
69+
70+
+#ifndef __has_attribute
71+
+#define __has_attribute(x) 0
72+
+#endif
73+
+
74+
+#if __has_attribute(__fallthrough__)
75+
+# define FALL_THROUGH __attribute__ ((fallthrough))
76+
+#else
77+
+# define FALL_THROUGH ((void)0) /* fall through */
78+
+#endif
79+
+
80+
typedef struct _LineState LineState;
81+
typedef struct _Point Point;
82+
83+
@@ -222,7 +232,7 @@ draw_underline (PangoRenderer *renderer,
84+
rect->y + 2 * rect->height,
85+
rect->width,
86+
rect->height);
87+
- /* Fall through */
88+
+ FALL_THROUGH;
89+
case PANGO_UNDERLINE_SINGLE:
90+
case PANGO_UNDERLINE_LOW:
91+
pango_renderer_draw_rectangle (renderer,
92+
diff --git a/tests/testboundaries_ucd.c b/tests/testboundaries_ucd.c
93+
index 1111111..2222222 100644
94+
--- a/tests/testboundaries_ucd.c
95+
+++ b/tests/testboundaries_ucd.c
96+
@@ -25,6 +25,16 @@
97+
#include <string.h>
98+
#include <locale.h>
99+
100+
+#ifndef __has_attribute
101+
+#define __has_attribute(x) 0
102+
+#endif
103+
+
104+
+#if __has_attribute(__fallthrough__)
105+
+# define FALL_THROUGH __attribute__ ((fallthrough))
106+
+#else
107+
+# define FALL_THROUGH ((void)0) /* fall through */
108+
+#endif
109+
+
110+
static gboolean failed = FALSE;
111+
112+
/* PangoLogAttr has to be the same size as guint or this hack breaks */
113+
@@ -104,7 +114,7 @@ parse_line (gchar *line,
114+
{
115+
case 0x00f7: /* DIVISION SIGN: boundary here */
116+
temp_attr.bits |= bits.bits;
117+
- /* fall through */
118+
+ FALL_THROUGH;
119+
120+
case 0x00d7: /* MULTIPLICATION SIGN: no boundary here */
121+
break;

0 commit comments

Comments
 (0)