From 982c40d4b5fc64ac0f0aca9d11b3ec65ea5e421b Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 15 Feb 2024 16:50:59 -0500 Subject: [PATCH] Fix build with mingw-gcc 14 https://fedoraproject.org/wiki/Changes/PortingToModernC https://fedoraproject.org/wiki/Changes/GNUToolchainF40 --- mingw-termcap.spec | 3 +++ termcap-1.3.1-implicit.patch | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 termcap-1.3.1-implicit.patch diff --git a/mingw-termcap.spec b/mingw-termcap.spec index fa44c2a..924378e 100644 --- a/mingw-termcap.spec +++ b/mingw-termcap.spec @@ -18,6 +18,8 @@ Summary: MinGW terminal feature database License: GPL-2.0-or-later URL: ftp://ftp.gnu.org/gnu/termcap/ Source0: ftp://ftp.gnu.org/gnu/termcap/termcap-%{version}.tar.gz +# Fix implicit function declarations +Patch0: termcap-1.3.1-implicit.patch BuildArch: noarch @@ -92,6 +94,7 @@ Static version of the cross compiled termcap library. %prep %setup -q -n termcap-%{version} +%patch -P0 -p1 # Packaged script doesn't understand --bindir, so rebuild: autoconf diff --git a/termcap-1.3.1-implicit.patch b/termcap-1.3.1-implicit.patch new file mode 100644 index 0000000..586fb7c --- /dev/null +++ b/termcap-1.3.1-implicit.patch @@ -0,0 +1,20 @@ +FTBFS with mingw-gcc 14: + +../tparam.c: In function 'memory_out': +../tparam.c:51:3: error: implicit declaration of function 'write' [-Wimplicit-function-declaration] + +diff --git a/tparam.c b/tparam.c +index 5a9809a..c9aceb1 100644 +--- a/tparam.c ++++ b/tparam.c +@@ -38,6 +38,10 @@ char *realloc (); + #define bcopy(s, d, n) memcpy ((d), (s), (n)) + #endif + ++#ifdef HAVE_UNISTD_H ++#include ++#endif ++ + #endif /* not emacs */ + + #ifndef NULL