/* Test of <math.h> substitute in C++ mode.
- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2010-2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2010. */
#include "signature.h"
/* Signature check for a function that takes a real-floating argument.
- Check that each overloaded function with the specified signature exists. */
+ Check that each overloaded function with the specified signature
+ exists in the GNULIB_NAMESPACE namespace. */
#define REAL_FLOATING_CHECK(func,\
rettype1, parameters1,\
rettype2, parameters2,\
OVERLOADED_CHECK (func, rettype3, parameters3, _3)
#define OVERLOADED_CHECK(func, rettype, parameters, suffix) \
static rettype (* _GL_UNUSED signature_check_ ## func ## suffix) parameters \
- = static_cast<rettype(*)parameters>(func)
+ = static_cast<rettype(*)parameters>(GNULIB_NAMESPACE::func)
/* Keep these checks in the same order as math.in.h! */
SIGNATURE_CHECK (GNULIB_NAMESPACE::floorl, long double, (long double));
#endif
+#if GNULIB_TEST_FMAF
+SIGNATURE_CHECK (GNULIB_NAMESPACE::fmaf, float, (float, float, float));
+#endif
+#if GNULIB_TEST_FMA
+SIGNATURE_CHECK (GNULIB_NAMESPACE::fma, double, (double, double, double));
+#endif
+#if GNULIB_TEST_FMAL
+SIGNATURE_CHECK (GNULIB_NAMESPACE::fmal, long double,
+ (long double, long double, long double));
+#endif
+
#if GNULIB_TEST_FMODF
SIGNATURE_CHECK (GNULIB_NAMESPACE::fmodf, float, (float, float));
#endif
//SIGNATURE_CHECK (GNULIB_NAMESPACE::lgamma, double, (double));
+#if GNULIB_TEST_LOGF
+SIGNATURE_CHECK (GNULIB_NAMESPACE::logf, float, (float));
+#endif
+#if GNULIB_TEST_LOG
+SIGNATURE_CHECK (GNULIB_NAMESPACE::log, double, (double));
+#endif
+#if GNULIB_TEST_LOGL
+SIGNATURE_CHECK (GNULIB_NAMESPACE::logl, long double, (long double));
+#endif
+
+#if GNULIB_TEST_LOG10F
+SIGNATURE_CHECK (GNULIB_NAMESPACE::log10f, float, (float));
+#endif
#if GNULIB_TEST_LOG10
SIGNATURE_CHECK (GNULIB_NAMESPACE::log10, double, (double));
#endif
SIGNATURE_CHECK (GNULIB_NAMESPACE::log1pl, long double, (long double));
#endif
-#if GNULIB_TEST_LOGF
-SIGNATURE_CHECK (GNULIB_NAMESPACE::logf, float, (float));
-#endif
-#if GNULIB_TEST_LOG
-SIGNATURE_CHECK (GNULIB_NAMESPACE::log, double, (double));
-#endif
-#if GNULIB_TEST_LOGL
-SIGNATURE_CHECK (GNULIB_NAMESPACE::logl, long double, (long double));
-#endif
-
-#if GNULIB_TEST_LOG10F
-SIGNATURE_CHECK (GNULIB_NAMESPACE::log10f, float, (float));
-#endif
-
#if GNULIB_TEST_LOG2F
SIGNATURE_CHECK (GNULIB_NAMESPACE::log2f, float, (float));
#endif
#if GNULIB_TEST_ISFINITE
# ifdef isfinite
-# error "isfinite should not be a macro in C++"
+# warning "isfinite should not be a macro in C++"
# endif
-REAL_FLOATING_CHECK (isfinite, int, (float), int, (double), int, (long double));
+REAL_FLOATING_CHECK (isfinite, bool, (float), bool, (double), bool, (long double));
#endif
#if GNULIB_TEST_ISINF
# ifdef isinf
-# error "isinf should not be a macro in C++"
+# warning "isinf should not be a macro in C++"
# endif
-REAL_FLOATING_CHECK (isinf, int, (float), int, (double), int, (long double));
+REAL_FLOATING_CHECK (isinf, bool, (float), bool, (double), bool, (long double));
#endif
#if GNULIB_TEST_ISNAN
# ifdef isnan
-# error "isnan should not be a macro in C++"
+# warning "isnan should not be a macro in C++"
# endif
-REAL_FLOATING_CHECK (isnan, int, (float), int, (double), int, (long double));
+REAL_FLOATING_CHECK (isnan, bool, (float), bool, (double), bool, (long double));
#endif
#if GNULIB_TEST_SIGNBIT
# ifdef signbit
-# error "signbit should not be a macro in C++"
+# warning "signbit should not be a macro in C++"
# endif
-REAL_FLOATING_CHECK (signbit, int, (float), int, (double), int, (long double));
+REAL_FLOATING_CHECK (signbit, bool, (float), bool, (double), bool, (long double));
#endif