From 1a38b869011bad46ce251e5919d0acb60ff3b522 Mon Sep 17 00:00:00 2001 From: Gautham Date: Thu, 12 Dec 2024 03:14:37 -0600 Subject: [PATCH] check for macros within __math/traits --- third_party/libcxx/__math/traits.h | 44 +++++++++++++++++++++++++ third_party/libcxx/cmath | 46 ++++++++++++++++++++++++++ third_party/libcxx/math.h | 52 +++--------------------------- 3 files changed, 94 insertions(+), 48 deletions(-) diff --git a/third_party/libcxx/__math/traits.h b/third_party/libcxx/__math/traits.h index 27ec52ece..2dc948e87 100644 --- a/third_party/libcxx/__math/traits.h +++ b/third_party/libcxx/__math/traits.h @@ -22,6 +22,50 @@ # pragma GCC system_header #endif +# ifdef signbit +# undef signbit +# endif + +# ifdef isfinite +# undef isfinite +# endif + +# ifdef isinf +# undef isinf +# endif + +# ifdef isnan +# undef isnan +# endif + +# ifdef isnormal +# undef isnormal +# endif + +# ifdef isgreater +# undef isgreater +# endif + +# ifdef isgreaterequal +# undef isgreaterequal +# endif + +# ifdef isless +# undef isless +# endif + +# ifdef islessequal +# undef islessequal +# endif + +# ifdef islessgreater +# undef islessgreater +# endif + +# ifdef isunordered +# undef isunordered +# endif + _LIBCPP_BEGIN_NAMESPACE_STD namespace __math { diff --git a/third_party/libcxx/cmath b/third_party/libcxx/cmath index 3c22604a6..fa636b5b6 100644 --- a/third_party/libcxx/cmath +++ b/third_party/libcxx/cmath @@ -341,6 +341,52 @@ constexpr long double lerp(long double a, long double b, long double t) noexcept _LIBCPP_PUSH_MACROS #include <__undef_macros> +# ifdef signbit +# undef signbit +# endif + +# ifdef isfinite +# undef isfinite +# endif + +# ifdef isinf +# undef isinf +# endif + +# ifdef isnan +# undef isnan +# endif + +# ifdef isnormal +# undef isnormal +# endif + +# ifdef isgreater +# undef isgreater +# endif + +# ifdef isgreaterequal +# undef isgreaterequal +# endif + +# ifdef isless +# undef isless +# endif + +# ifdef islessequal +# undef islessequal +# endif + +# ifdef islessgreater +# undef islessgreater +# endif + +# ifdef isunordered +# undef isunordered +# endif + + + _LIBCPP_BEGIN_NAMESPACE_STD using ::signbit _LIBCPP_USING_IF_EXISTS; diff --git a/third_party/libcxx/math.h b/third_party/libcxx/math.h index 4e6304a75..d4eba0e81 100644 --- a/third_party/libcxx/math.h +++ b/third_party/libcxx/math.h @@ -307,54 +307,6 @@ long double truncl(long double x); // back to C++ linkage before including these C++ headers. extern "C++" { -# ifdef fpclassify -# undef fpclassify -# endif - -# ifdef signbit -# undef signbit -# endif - -# ifdef isfinite -# undef isfinite -# endif - -# ifdef isinf -# undef isinf -# endif - -# ifdef isnan -# undef isnan -# endif - -# ifdef isnormal -# undef isnormal -# endif - -# ifdef isgreater -# undef isgreater -# endif - -# ifdef isgreaterequal -# undef isgreaterequal -# endif - -# ifdef isless -# undef isless -# endif - -# ifdef islessequal -# undef islessequal -# endif - -# ifdef islessgreater -# undef islessgreater -# endif - -# ifdef isunordered -# undef isunordered -# endif - # include <__math/abs.h> # include <__math/copysign.h> # include <__math/error_functions.h> @@ -379,6 +331,10 @@ extern "C++" { # include <__type_traits/is_integral.h> # include +# ifdef fpclassify +# undef fpclassify +# endif + // fpclassify relies on implementation-defined constants, so we can't move it to a detail header _LIBCPP_BEGIN_NAMESPACE_STD