commit | e76961fac58c34c61bb52ed3887917300f0e37a3 | [log] [tgz] |
---|---|---|
author | Ryan Prichard <rprichard@google.com> | Fri Dec 20 13:46:02 2024 -0800 |
committer | swiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com <swiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Dec 27 07:21:31 2024 -0800 |
tree | a37ff66a9bb39c50f68e4e6e6e5745075fd5686b | |
parent | 118f577b4188528566a1f23d88c4f0041372b83a [diff] |
regcomp: avoid a namespace collision with C23 <float.h> C23 adds the INFINITY macro to float.h and obsoletes the INFINITY macro in math.h. Clang's float.h declares the INFINITY macro even in older GNU modes, like -std=gnu99. Bionic's limits.h includes float.h, so the conflicting INFINITY macro prevents compiling regcomp.c. Bug: b/384985989 Change-Id: Id1ad71268b94f93855dcfa6a853ac7c86afbae52 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/74568 Tested-by: Shahbaz Youssefi <syoussefi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@google.com>
diff --git a/third_party/llvm-10.0/llvm/lib/Support/regcomp.c b/third_party/llvm-10.0/llvm/lib/Support/regcomp.c index ee2a1d8..b7abc1d 100644 --- a/third_party/llvm-10.0/llvm/lib/Support/regcomp.c +++ b/third_party/llvm-10.0/llvm/lib/Support/regcomp.c
@@ -278,6 +278,7 @@ #else #define DUPMAX 255 #endif +#undef INFINITY // avoid collision with C23 <float.h> INFINITY (via <limits.h> on Bionic) #define INFINITY (DUPMAX + 1) #ifndef NDEBUG
diff --git a/third_party/llvm-16.0/llvm/lib/Support/regcomp.c b/third_party/llvm-16.0/llvm/lib/Support/regcomp.c index 9d48419..9482784 100644 --- a/third_party/llvm-16.0/llvm/lib/Support/regcomp.c +++ b/third_party/llvm-16.0/llvm/lib/Support/regcomp.c
@@ -278,6 +278,7 @@ #else #define DUPMAX 255 #endif +#undef INFINITY // avoid collision with C23 <float.h> INFINITY (via <limits.h> on Bionic) #define INFINITY (DUPMAX + 1) #ifndef NDEBUG
diff --git a/third_party/llvm-subzero/lib/Support/regcomp.c b/third_party/llvm-subzero/lib/Support/regcomp.c index ebde64f..05bd388 100644 --- a/third_party/llvm-subzero/lib/Support/regcomp.c +++ b/third_party/llvm-subzero/lib/Support/regcomp.c
@@ -150,6 +150,7 @@ #else #define DUPMAX 255 #endif +#undef INFINITY // avoid collision with C23 <float.h> INFINITY (via <limits.h> on Bionic) #define INFINITY (DUPMAX + 1) #ifndef NDEBUG