master hovercats/oakiss / repo / unifdef / patches / 0001-Don-t-use-C23-constexpr-keyword.patch
 1From 4192ee765e1263be6bed4cf3460cf8cd67980427 Mon Sep 17 00:00:00 2001
 2From: Sam James <sam@gentoo.org>
 3Date: Sun, 17 Nov 2024 01:26:27 +0000
 4Subject: [PATCH] Don't use C23 constexpr keyword
 5
 6This fixes building with upcoming GCC 15 which defaults to -std=gnu23.
 7---
 8 unifdef.c | 10 +++++-----
 9 1 file changed, 5 insertions(+), 5 deletions(-)
10
11diff --git a/unifdef.c b/unifdef.c
12index dc145a2..4bd3bda 100644
13--- a/unifdef.c
14+++ b/unifdef.c
15@@ -202,7 +202,7 @@ static int              depth;			/* current #if nesting */
16 static int              delcount;		/* count of deleted lines */
17 static unsigned         blankcount;		/* count of blank lines */
18 static unsigned         blankmax;		/* maximum recent blankcount */
19-static bool             constexpr;		/* constant #if expression */
20+static bool             is_constexpr;		/* constant #if expression */
21 static bool             zerosyms;		/* to format symdepth output */
22 static bool             firstsym;		/* ditto */
23 
24@@ -1086,7 +1086,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
25 			*valp = (value[sym] != NULL);
26 			lt = *valp ? LT_TRUE : LT_FALSE;
27 		}
28-		constexpr = false;
29+		is_constexpr = false;
30 	} else if (!endsym(*cp)) {
31 		debug("eval%d symbol", prec(ops));
32 		sym = findsym(&cp);
33@@ -1103,7 +1103,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
34 			lt = *valp ? LT_TRUE : LT_FALSE;
35 			cp = skipargs(cp);
36 		}
37-		constexpr = false;
38+		is_constexpr = false;
39 	} else {
40 		debug("eval%d bad expr", prec(ops));
41 		return (LT_ERROR);
42@@ -1170,10 +1170,10 @@ ifeval(const char **cpp)
43 	long val = 0;
44 
45 	debug("eval %s", *cpp);
46-	constexpr = killconsts ? false : true;
47+	is_constexpr = killconsts ? false : true;
48 	ret = eval_table(eval_ops, &val, cpp);
49 	debug("eval = %d", val);
50-	return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
51+	return (is_constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
52 }
53 
54 /*
55-- 
562.49.0
57