File Reaction-rename-constexpr.patch of Package Reaction
From 6f02cebe3ac9ab120ec64154446f21a9675271d1 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Mon, 8 Dec 2025 02:55:22 +0000
Subject: [PATCH] Rename constexpr
because that is now a reserved keyword in gcc15
---
code/tools/lcc/src/c.h | 2 +-
code/tools/lcc/src/simp.c | 4 ++--
code/tools/lcc/src/stmt.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/code/tools/lcc/src/c.h b/code/tools/lcc/src/c.h
index 68c8f62..40993d8 100644
--- a/code/tools/lcc/src/c.h
+++ b/code/tools/lcc/src/c.h
@@ -644,7 +644,7 @@ extern int process(char *);
extern int findfunc(char *, char *);
extern int findcount(char *, int, int);
-extern Tree constexpr(int);
+extern Tree constexprx(int);
extern int intexpr(int, int);
extern Tree simplify(int, Type, Tree, Tree);
extern int ispow2(unsigned long u);
diff --git a/code/tools/lcc/src/simp.c b/code/tools/lcc/src/simp.c
index ea26ab6..9dba888 100644
--- a/code/tools/lcc/src/simp.c
+++ b/code/tools/lcc/src/simp.c
@@ -182,7 +182,7 @@ static int subi(long x, long y, long min, long max, int needconst) {
static int subd(double x, double y, double min, double max, int needconst) {
return addd(x, -y, min, max, needconst);
}
-Tree constexpr(int tok) {
+Tree constexprx(int tok) {
Tree p;
needconst++;
@@ -192,7 +192,7 @@ Tree constexpr(int tok) {
}
int intexpr(int tok, int n) {
- Tree p = constexpr(tok);
+ Tree p = constexprx(tok);
needconst++;
if (p->op == CNST+I || p->op == CNST+U)
diff --git a/code/tools/lcc/src/stmt.c b/code/tools/lcc/src/stmt.c
index 9c3bdbe..72f5a47 100644
--- a/code/tools/lcc/src/stmt.c
+++ b/code/tools/lcc/src/stmt.c
@@ -119,7 +119,7 @@ void statement(int loop, Swtch swp, int lev) {
static char stop[] = { IF, ID, 0 };
Tree p;
t = gettok();
- p = constexpr(0);
+ p = constexprx(0);
if (generic(p->op) == CNST && isint(p->type)) {
if (swp) {
needconst++;
--
2.51.0