[libc] [llvm] [libc] Add proxy header for float.h. (PR #93504)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 10:17:16 PDT 2024


================
@@ -9,165 +9,346 @@
 #ifndef LLVM_LIBC_MACROS_FLOAT_MACROS_H
 #define LLVM_LIBC_MACROS_FLOAT_MACROS_H
 
-// Suppress `#include_next is a language extension` warnings.
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wgnu-include-next"
-#pragma clang diagnostic ignored "-Winclude-next-absolute-path"
-#else // gcc
-#pragma GCC system_header
-#endif //__clang__
-
-#include_next <float.h>
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif //__clang__
+// Check long double.
+#if defined(__linux__) && defined(__x86_64__)
+#define LLVM_LIBC_MACROS_LONG_DOUBLE_IS_FLOAT80
+#elif defined(__linux__) && (defined(__aarch64__) || defined(__riscv))
+#define LLVM_LIBC_MACROS_LONG_DOUBLE_IS_FLOAT128
+#else
+#define LLVM_LIBC_MACROS_LONG_DOUBLE_IS_FLOAT64
+#endif
 
 #ifndef FLT_RADIX
+#ifdef __FLT_RADIX__
----------------
lntue wrote:

I haven't checked exhaustively, but musl does hardcoded `FLT_RADIX` and many others, so I would assume there are cases of missing predefined macros.

https://github.com/llvm/llvm-project/pull/93504


More information about the llvm-commits mailing list