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

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue May 28 10:26:21 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__
----------------
nickdesaulniers wrote:

Please do check; I suspect that musl supports older compilers that we do not.  We should not add code to support such older compilers. Instead, we should encourage users to move to newer toolchains by explicitly not supporting the older ones (even if that means breaking their builds).

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


More information about the libc-commits mailing list