gentoo-ebuilds/app-shells/rc/files/rc-1.7.4-C23.patch
NHOrus a4bfadcafd
app-shells/rc: fix build failure, port to C23 For libedit, we need to carefully truncate size_t to int but that's number of lines, so it should work in sane situations
C23 porting is limited to autoreconf and dealing with bool defines
Code is not bit-rotten too much

Bug: https://bugs.gentoo.org/925558
Signed-off-by: NHOrus <jy6x2b32pie9@yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/39989
Signed-off-by: Sam James <sam@gentoo.org>
2025-02-10 09:19:40 +00:00

30 lines
801 B
Diff

just use build-ins when C is modern enough
and other glibc defines that need enablement
diff -ru a/rc.h b/rc.h
--- a/rc.h 2025-01-05 21:16:39.487999355 +0400
+++ b/rc.h 2025-01-05 21:21:13.688559101 +0400
@@ -44,9 +44,14 @@
eError, eBreak, eReturn, eVarstack, eArena, eFifo, eFd
} ecodes;
+#if __STDC_VERSION__ <= 201710L
typedef enum bool {
FALSE, TRUE
} bool;
+#else
+#define FALSE false
+#define TRUE true
+#endif
typedef enum redirtype {
rFrom, rCreate, rAppend, rHeredoc, rHerestring
diff -ru a/configure.ac b/configure.ac
--- a/configure.ac 2025-01-05 21:33:03.952267739 +0400
+++ b/configure.ac 2025-01-05 21:33:20.702194221 +0400
@@ -1,5 +1,6 @@
dnl Our package name, version, ...
AC_INIT([rc], [1.7.4])
+AC_USE_SYSTEM_EXTENSIONS
dnl ... and release date
RELDATE=`date -I`