Skip to content

Commit 32e2000

Browse files
daltentytru
authored andcommitted
[NFC][llvm][support] rename INFINITY in regcomp (#101758)
since C23 this macro is defined by float.h, which clang implements in it's float.h since #96659 landed. However, regcomp.c in LLVMSupport happened to define it's own macro with that name, leading to problems when bootstrapping. This change renames the offending macro. (cherry picked from commit 899f648)
1 parent 2da001d commit 32e2000

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Support/regcomp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static char nuls[10]; /* place to point scanner in event of error */
278278
#else
279279
#define DUPMAX 255
280280
#endif
281-
#define INFINITY (DUPMAX + 1)
281+
#define REGINFINITY (DUPMAX + 1)
282282

283283
#ifndef NDEBUG
284284
static int never = 0; /* for use in asserts; shuts lint up */
@@ -582,7 +582,7 @@ p_ere_exp(struct parse *p)
582582
count2 = p_count(p);
583583
REQUIRE(count <= count2, REG_BADBR);
584584
} else /* single number with comma */
585-
count2 = INFINITY;
585+
count2 = REGINFINITY;
586586
} else /* just a single number */
587587
count2 = count;
588588
repeat(p, pos, count, count2);
@@ -753,7 +753,7 @@ p_simp_re(struct parse *p,
753753
count2 = p_count(p);
754754
REQUIRE(count <= count2, REG_BADBR);
755755
} else /* single number with comma */
756-
count2 = INFINITY;
756+
count2 = REGINFINITY;
757757
} else /* just a single number */
758758
count2 = count;
759759
repeat(p, pos, count, count2);
@@ -1115,7 +1115,7 @@ repeat(struct parse *p,
11151115
# define N 2
11161116
# define INF 3
11171117
# define REP(f, t) ((f)*8 + (t))
1118-
# define MAP(n) (((n) <= 1) ? (n) : ((n) == INFINITY) ? INF : N)
1118+
# define MAP(n) (((n) <= 1) ? (n) : ((n) == REGINFINITY) ? INF : N)
11191119
sopno copy;
11201120

11211121
if (p->error != 0) /* head off possible runaway recursion */

0 commit comments

Comments
 (0)