commit 6b26734
hovercats
·
2026-02-04 09:12:03 +0000 UTC
parent 18e145f
unifdef: add patch for gcc 15
4 files changed,
+62,
-1
+3,
-1
1@@ -1,5 +1,7 @@
2 #!/bin/sh -e
3
4+patch -p1 < 0001-Don-t-use-C23-constexpr-keyword.patch
5+
6 make LDFLAGS="$LDFLAGS -static"
7 make DESTDIR="$1" prefix=/usr install
8
9@@ -7,4 +9,4 @@ make DESTDIR="$1" prefix=/usr install
10 find "$1/usr/share/man" -type f -exec gzip -n -9 {} +
11
12 # Remove broken symlinks
13-rm -r "$1/usr/share/man/man1/unifdefall.1"
14+rm -rf "$1/usr/share/man/man1/unifdefall.1"
+1,
-0
1@@ -1 +1,2 @@
2 c55349ab244ae3705c566107426f61d9b7ffdbb9fd99261986f8d54867628bcc0e
3+636426d8de8fd605d62331e05255b604512d71ef37ffe7ad764846aff97c4b6efc
1@@ -0,0 +1,57 @@
2+From 4192ee765e1263be6bed4cf3460cf8cd67980427 Mon Sep 17 00:00:00 2001
3+From: Sam James <sam@gentoo.org>
4+Date: Sun, 17 Nov 2024 01:26:27 +0000
5+Subject: [PATCH] Don't use C23 constexpr keyword
6+
7+This fixes building with upcoming GCC 15 which defaults to -std=gnu23.
8+---
9+ unifdef.c | 10 +++++-----
10+ 1 file changed, 5 insertions(+), 5 deletions(-)
11+
12+diff --git a/unifdef.c b/unifdef.c
13+index dc145a2..4bd3bda 100644
14+--- a/unifdef.c
15++++ b/unifdef.c
16+@@ -202,7 +202,7 @@ static int depth; /* current #if nesting */
17+ static int delcount; /* count of deleted lines */
18+ static unsigned blankcount; /* count of blank lines */
19+ static unsigned blankmax; /* maximum recent blankcount */
20+-static bool constexpr; /* constant #if expression */
21++static bool is_constexpr; /* constant #if expression */
22+ static bool zerosyms; /* to format symdepth output */
23+ static bool firstsym; /* ditto */
24+
25+@@ -1086,7 +1086,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
26+ *valp = (value[sym] != NULL);
27+ lt = *valp ? LT_TRUE : LT_FALSE;
28+ }
29+- constexpr = false;
30++ is_constexpr = false;
31+ } else if (!endsym(*cp)) {
32+ debug("eval%d symbol", prec(ops));
33+ sym = findsym(&cp);
34+@@ -1103,7 +1103,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
35+ lt = *valp ? LT_TRUE : LT_FALSE;
36+ cp = skipargs(cp);
37+ }
38+- constexpr = false;
39++ is_constexpr = false;
40+ } else {
41+ debug("eval%d bad expr", prec(ops));
42+ return (LT_ERROR);
43+@@ -1170,10 +1170,10 @@ ifeval(const char **cpp)
44+ long val = 0;
45+
46+ debug("eval %s", *cpp);
47+- constexpr = killconsts ? false : true;
48++ is_constexpr = killconsts ? false : true;
49+ ret = eval_table(eval_ops, &val, cpp);
50+ debug("eval = %d", val);
51+- return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
52++ return (is_constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
53+ }
54+
55+ /*
56+--
57+2.49.0
58+
+1,
-0
1@@ -1 +1,2 @@
2 https://dotat.at/prog/unifdef/unifdef-2.12.tar.xz
3+patches/0001-Don-t-use-C23-constexpr-keyword.patch