From c258856c895a147d6701cf74659dd0d919d0e099 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Thu, 16 Jun 2022 11:08:43 +0100 Subject: [PATCH] "#undef extended" temporarily to avoid conflict on GNU Hurd MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Origin: vendor Forwarded: https://github.com/fontforge/fontforge/pull/5047 Last-Update: 2022-06-16 GNU Mach microkernel header files (gnumach-dev 1.8+git20201129) added to struct i386_xfp_save in /usr/include/i386-gnu/include/mach/i386/fp_reg.h a new "extended" field which happens to collide with the macro definition "#define extended double" in FontForge, leading to FTBFS on GNU Hurd: FAILED: fontforge/CMakeFiles/fontforge.dir/asmfpst.c.o /usr/bin/cc -Dfontforge_EXPORTS -I../../fontforge -I../../inc -Iinc -isystem /usr/include/glib-2.0 -isystem /usr/lib/i386-gnu/glib-2.0/include -isystem /usr/include/freetype2 -isystem /usr/include/libxml2 -isystem /usr/include/readline -isystem /usr/include/python3.9 -g -O2 -ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Werror=implicit-function-declaration -Werror=int-conversion -fdiagnostics-color=always -std=gnu99 -MD -MT fontforge/CMakeFiles/fontforge.dir/asmfpst.c.o -MF fontforge/CMakeFiles/fontforge.dir/asmfpst.c.o.d -o fontforge/CMakeFiles/fontforge.dir/asmfpst.c.o -c ../../fontforge/asmfpst.c In file included from ../../fontforge/asmfpst.h:4, from ../../fontforge/asmfpst.c:30: ../../fontforge/splinefont.h:63:18: error: two or more data types in declaration specifiers 63 | #define extended double | ^~~~~~ In file included from /usr/include/i386-gnu/bits/sigcontext.h:30, from /usr/include/signal.h:291, from /usr/include/glib-2.0/glib/gbacktrace.h:36, from /usr/include/glib-2.0/glib.h:34, from /usr/include/glib-2.0/gobject/gbinding.h:28, from /usr/include/glib-2.0/glib-object.h:22, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from ../../inc/ffglib.h:29, from ../../fontforge/baseviews.h:31, from ../../fontforge/fontforgevw.h:31, from ../../fontforge/asmfpst.c:33: /usr/include/i386-gnu/mach/i386/fp_reg.h:80:24: error: expected identifier or ‘(’ before ‘[’ token 80 | unsigned char extended[0]; /* Extended region */ | ^ This patch temporarily undefines the "extended" macro before loading and friends, and redefines the "extended" macro right after. and redefines it afterwards. Last-Update: 2022-06-16 Gbp-Pq: Name 0005-hurd-undef-extended-temporarily.patch --- inc/ffglib.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/ffglib.h b/inc/ffglib.h index f3419f0..25fe9eb 100644 --- a/inc/ffglib.h +++ b/inc/ffglib.h @@ -26,11 +26,19 @@ #define GMenuItem GMenuItem_GIO #define GTimer GTimer_GTK +#ifdef __GNU__ +# undef extended +#endif + #include #include #include #include +#ifdef __GNU__ +# define extended double +#endif + #undef GList #undef GMenuItem #undef GTimer -- 2.30.2