From 7ea9a798ae46ee65495c5308cfeddfccfaa5cea5 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 24 Aug 2024 01:28:10 -0400 Subject: [PATCH] libroot/glibc: Use __builtin_isnan and let the compiler figure out types. This is what we do in already. Fixes compile errors with Clang. --- src/system/libroot/posix/glibc/math/complex.h | 10 +++++----- src/system/libroot/posix/glibc/math/math_private.h | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/system/libroot/posix/glibc/math/complex.h b/src/system/libroot/posix/glibc/math/complex.h index 7172cb6b63..c1f52b5900 100644 --- a/src/system/libroot/posix/glibc/math/complex.h +++ b/src/system/libroot/posix/glibc/math/complex.h @@ -27,13 +27,13 @@ __BEGIN_DECLS -#if __GNUC__ >= 7 -#define __isinfl(value) __builtin_isinfl(value) +#if __GNUC__ >= 7 || defined(__clang__) #define __isnan(value) __builtin_isnan(value) -#define __isnanf(value) __builtin_isnanf(value) -#define __isnanl(value) __builtin_isnanl(value) +#define __isnanf(value) __builtin_isnan(value) +#define __isnanl(value) __builtin_isnan(value) #define __isinf(value) __builtin_isinf(value) -#define __isinff(value) __builtin_isinff(value) +#define __isinff(value) __builtin_isinf(value) +#define __isinfl(value) __builtin_isinf(value) #endif /* We might need to add support for more compilers here. But since ISO diff --git a/src/system/libroot/posix/glibc/math/math_private.h b/src/system/libroot/posix/glibc/math/math_private.h index 2c8f804d9b..6a75c49bfa 100644 --- a/src/system/libroot/posix/glibc/math/math_private.h +++ b/src/system/libroot/posix/glibc/math/math_private.h @@ -286,8 +286,6 @@ extern int __kernel_rem_pio2l (long double*,long double*,int,int, /* prototypes required to compile the ldbl-96 support without warnings */ extern int __finitel (long double); extern int __ilogbl (long double); -extern int __isinfl (long double); -extern int __isnanl (long double); extern long double __atanl (long double); extern long double __copysignl (long double, long double); extern long double __expm1l (long double);