From 3308ca32864e34c28c8813f7abf7e00d517d4e1d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 13 Apr 2022 23:43:05 +0200 Subject: math: Fix errors in C++ mode on glibc systems with clang. * lib/math.in.h (GNULIB_NAMESPACE_LACKS_ISFINITE, GNULIB_NAMESPACE_LACKS_ISINF, GNULIB_NAMESPACE_LACKS_ISNAN, GNULIB_NAMESPACE_LACKS_SIGNBIT): New macros. * tests/test-math-c++.cc (isfinite): Skip test if GNULIB_NAMESPACE_LACKS_ISFINITE is 1. (isinf): Skip test if GNULIB_NAMESPACE_LACKS_ISINF is 1. (isnan): Skip test if GNULIB_NAMESPACE_LACKS_ISNAN is 1. (signbit): Skip test if GNULIB_NAMESPACE_LACKS_SIGNBIT is 1. --- tests/test-math-c++.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/test-math-c++.cc') diff --git a/tests/test-math-c++.cc b/tests/test-math-c++.cc index e9a7bfa6a5..6749fa58a1 100644 --- a/tests/test-math-c++.cc +++ b/tests/test-math-c++.cc @@ -385,28 +385,36 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::truncl, long double, (long double)); # ifdef isfinite # warning "isfinite should not be a macro in C++" # endif +# if !GNULIB_NAMESPACE_LACKS_ISFINITE REAL_FLOATING_CHECK (isfinite, bool, (float), bool, (double), bool, (long double)); +# endif #endif #if GNULIB_TEST_ISINF # ifdef isinf # warning "isinf should not be a macro in C++" # endif +# if !GNULIB_NAMESPACE_LACKS_ISINF REAL_FLOATING_CHECK (isinf, bool, (float), bool, (double), bool, (long double)); +# endif #endif #if GNULIB_TEST_ISNAN # ifdef isnan # warning "isnan should not be a macro in C++" # endif +# if !GNULIB_NAMESPACE_LACKS_ISNAN REAL_FLOATING_CHECK (isnan, bool, (float), bool, (double), bool, (long double)); +# endif #endif #if GNULIB_TEST_SIGNBIT # ifdef signbit # warning "signbit should not be a macro in C++" # endif +# if !GNULIB_NAMESPACE_LACKS_SIGNBIT REAL_FLOATING_CHECK (signbit, bool, (float), bool, (double), bool, (long double)); +# endif #endif -- cgit v1.2.1