aboutsummaryrefslogtreecommitdiff
path: root/gnulib/import/math.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib/import/math.in.h')
-rw-r--r--gnulib/import/math.in.h254
1 files changed, 204 insertions, 50 deletions
diff --git a/gnulib/import/math.in.h b/gnulib/import/math.in.h
index 30465f8..6208a01 100644
--- a/gnulib/import/math.in.h
+++ b/gnulib/import/math.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <math.h>.
- Copyright (C) 2002-2003, 2007-2020 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2007-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
@@ -22,8 +22,23 @@
#endif
@PRAGMA_COLUMNS@
+#if defined _GL_INCLUDING_MATH_H
+/* Special invocation convention:
+ - On FreeBSD 12.2 we have a sequence of nested includes
+ <math.h> -> <stdlib.h> -> <sys/wait.h> -> <sys/types.h> -> <sys/select.h>
+ -> <signal.h> -> <pthread.h> -> <stdlib.h> -> <math.h>
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
+
+#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+
+#else
+/* Normal invocation convention. */
+
/* The include_next requires a split double-inclusion guard. */
+#define _GL_INCLUDING_MATH_H
#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+#undef _GL_INCLUDING_MATH_H
#ifndef _@GUARD_PREFIX@_MATH_H
#define _@GUARD_PREFIX@_MATH_H
@@ -127,12 +142,6 @@ static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq;
#endif
-/* For clang: Use __has_builtin to determine whether a builtin is available. */
-#ifndef __has_builtin
-# define __has_builtin(name) 0
-#endif
-
-
/* POSIX allows platforms that don't support NAN. But all major
machines in the past 15 years have supported something close to
IEEE NaN, so we define this unconditionally. We also must define
@@ -261,7 +270,9 @@ _GL_WARN_ON_USE (acosf, "acosf is unportable - "
_GL_FUNCDECL_SYS (acosl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (acosl, long double, (long double x));
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (acosl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef acosl
# if HAVE_RAW_DECL_ACOSL
@@ -301,7 +312,9 @@ _GL_WARN_ON_USE (asinf, "asinf is unportable - "
_GL_FUNCDECL_SYS (asinl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (asinl, long double, (long double x));
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (asinl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef asinl
# if HAVE_RAW_DECL_ASINL
@@ -341,7 +354,9 @@ _GL_WARN_ON_USE (atanf, "atanf is unportable - "
_GL_FUNCDECL_SYS (atanl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (atanl, long double, (long double x));
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (atanl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef atanl
# if HAVE_RAW_DECL_ATANL
@@ -405,7 +420,7 @@ _GL_FUNCDECL_SYS (cbrt, double, (double x));
# endif
_GL_CXXALIAS_SYS (cbrt, double, (double x));
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (cbrt);
+_GL_CXXALIASWARN1 (cbrt, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef cbrt
@@ -475,7 +490,7 @@ _GL_CXXALIAS_RPL (ceil, double, (double x));
_GL_CXXALIAS_SYS (ceil, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (ceil);
+_GL_CXXALIASWARN1 (ceil, double, (double x));
# endif
#endif
@@ -494,7 +509,9 @@ _GL_FUNCDECL_SYS (ceill, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (ceill, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ceill);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef ceill
# if HAVE_RAW_DECL_CEILL
@@ -525,7 +542,7 @@ _GL_FUNCDECL_SYS (copysign, double, (double x, double y));
# endif
_GL_CXXALIAS_SYS (copysign, double, (double x, double y));
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (copysign);
+_GL_CXXALIASWARN1 (copysign, double, (double x, double y));
# endif
#elif defined GNULIB_POSIXCHECK
# undef copysign
@@ -580,7 +597,9 @@ _GL_WARN_ON_USE (cosf, "cosf is unportable - "
_GL_FUNCDECL_SYS (cosl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (cosl, long double, (long double x));
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (cosl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef cosl
# if HAVE_RAW_DECL_COSL
@@ -654,7 +673,9 @@ _GL_FUNCDECL_SYS (expl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (expl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (expl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef expl
# if HAVE_RAW_DECL_EXPL
@@ -693,7 +714,7 @@ _GL_FUNCDECL_SYS (exp2, double, (double x));
_GL_CXXALIAS_SYS (exp2, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (exp2);
+_GL_CXXALIASWARN1 (exp2, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef exp2
@@ -766,7 +787,7 @@ _GL_FUNCDECL_SYS (expm1, double, (double x));
_GL_CXXALIAS_SYS (expm1, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (expm1);
+_GL_CXXALIASWARN1 (expm1, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef expm1
@@ -809,7 +830,9 @@ _GL_WARN_ON_USE (expm1l, "expm1l is unportable - "
_GL_FUNCDECL_SYS (fabsf, float, (float x));
# endif
_GL_CXXALIAS_SYS (fabsf, float, (float x));
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (fabsf);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef fabsf
# if HAVE_RAW_DECL_FABSF
@@ -833,7 +856,9 @@ _GL_FUNCDECL_SYS (fabsl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (fabsl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (fabsl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef fabsl
# if HAVE_RAW_DECL_FABSL
@@ -879,7 +904,7 @@ _GL_CXXALIAS_RPL (floor, double, (double x));
_GL_CXXALIAS_SYS (floor, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (floor);
+_GL_CXXALIASWARN1 (floor, double, (double x));
# endif
#endif
@@ -898,7 +923,9 @@ _GL_FUNCDECL_SYS (floorl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (floorl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (floorl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef floorl
# if HAVE_RAW_DECL_FLOORL
@@ -948,7 +975,7 @@ _GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
_GL_CXXALIAS_SYS (fma, double, (double x, double y, double z));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (fma);
+_GL_CXXALIASWARN1 (fma, double, (double x, double y, double z));
# endif
#elif defined GNULIB_POSIXCHECK
# undef fma
@@ -1025,7 +1052,7 @@ _GL_CXXALIAS_RPL (fmod, double, (double x, double y));
_GL_CXXALIAS_SYS (fmod, double, (double x, double y));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (fmod);
+_GL_CXXALIASWARN1 (fmod, double, (double x, double y));
# endif
#elif defined GNULIB_POSIXCHECK
# undef fmod
@@ -1050,7 +1077,9 @@ _GL_FUNCDECL_SYS (fmodl, long double, (long double x, long double y));
# endif
_GL_CXXALIAS_SYS (fmodl, long double, (long double x, long double y));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (fmodl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef fmodl
# if HAVE_RAW_DECL_FMODL
@@ -1082,7 +1111,9 @@ _GL_FUNCDECL_SYS (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (frexpf);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef frexpf
# if HAVE_RAW_DECL_FREXPF
@@ -1144,7 +1175,9 @@ _GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr));
# endif
#endif
#if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (frexpl);
+# endif
#endif
#if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
# undef frexpl
@@ -1170,7 +1203,9 @@ _GL_FUNCDECL_SYS (hypotf, float, (float x, float y));
# endif
_GL_CXXALIAS_SYS (hypotf, float, (float x, float y));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (hypotf);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef hypotf
# if HAVE_RAW_DECL_HYPOTF
@@ -1192,7 +1227,7 @@ _GL_CXXALIAS_RPL (hypot, double, (double x, double y));
_GL_CXXALIAS_SYS (hypot, double, (double x, double y));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (hypot);
+_GL_CXXALIASWARN1 (hypot, double, (double x, double y));
# endif
#elif defined GNULIB_POSIXCHECK
# undef hypot
@@ -1217,7 +1252,9 @@ _GL_FUNCDECL_SYS (hypotl, long double, (long double x, long double y));
# endif
_GL_CXXALIAS_SYS (hypotl, long double, (long double x, long double y));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (hypotl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef hypotl
# if HAVE_RAW_DECL_HYPOTL
@@ -1265,7 +1302,7 @@ _GL_FUNCDECL_SYS (ilogb, int, (double x));
_GL_CXXALIAS_SYS (ilogb, int, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (ilogb);
+_GL_CXXALIASWARN1 (ilogb, int, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef ilogb
@@ -1299,6 +1336,55 @@ _GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - "
#endif
+#if @GNULIB_MDA_J0@
+/* On native Windows, map 'j0' to '_j0', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::j0 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef j0
+# define j0 _j0
+# endif
+_GL_CXXALIAS_MDA (j0, double, (double x));
+# else
+_GL_CXXALIAS_SYS (j0, double, (double x));
+# endif
+_GL_CXXALIASWARN (j0);
+#endif
+
+#if @GNULIB_MDA_J1@
+/* On native Windows, map 'j1' to '_j1', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::j1 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef j1
+# define j1 _j1
+# endif
+_GL_CXXALIAS_MDA (j1, double, (double x));
+# else
+_GL_CXXALIAS_SYS (j1, double, (double x));
+# endif
+_GL_CXXALIASWARN (j1);
+#endif
+
+#if @GNULIB_MDA_JN@
+/* On native Windows, map 'jn' to '_jn', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::jn always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef jn
+# define jn _jn
+# endif
+_GL_CXXALIAS_MDA (jn, double, (int n, double x));
+# else
+_GL_CXXALIAS_SYS (jn, double, (int n, double x));
+# endif
+_GL_CXXALIASWARN (jn);
+#endif
+
+
/* Return x * 2^exp. */
#if @GNULIB_LDEXPF@
# if !@HAVE_LDEXPF@
@@ -1306,7 +1392,9 @@ _GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - "
_GL_FUNCDECL_SYS (ldexpf, float, (float x, int exp));
# endif
_GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp));
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ldexpf);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef ldexpf
# if HAVE_RAW_DECL_LDEXPF
@@ -1332,7 +1420,9 @@ _GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp));
# endif
#endif
#if @GNULIB_LDEXPL@
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ldexpl);
+# endif
#endif
#if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
# undef ldexpl
@@ -1379,7 +1469,7 @@ _GL_CXXALIAS_RPL (log, double, (double x));
_GL_CXXALIAS_SYS (log, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (log);
+_GL_CXXALIASWARN1 (log, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef log
@@ -1404,7 +1494,9 @@ _GL_FUNCDECL_SYS (logl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (logl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (logl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef logl
# if HAVE_RAW_DECL_LOGL
@@ -1450,7 +1542,7 @@ _GL_CXXALIAS_RPL (log10, double, (double x));
_GL_CXXALIAS_SYS (log10, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (log10);
+_GL_CXXALIASWARN1 (log10, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef log10
@@ -1475,7 +1567,9 @@ _GL_FUNCDECL_SYS (log10l, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (log10l, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (log10l);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef log10l
# if HAVE_RAW_DECL_LOG10L
@@ -1523,7 +1617,7 @@ _GL_FUNCDECL_SYS (log1p, double, (double x));
_GL_CXXALIAS_SYS (log1p, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (log1p);
+_GL_CXXALIASWARN1 (log1p, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef log1p
@@ -1597,7 +1691,7 @@ _GL_FUNCDECL_SYS (log2, double, (double x));
_GL_CXXALIAS_SYS (log2, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (log2);
+_GL_CXXALIASWARN1 (log2, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef log2
@@ -1669,7 +1763,7 @@ _GL_FUNCDECL_SYS (logb, double, (double x));
_GL_CXXALIAS_SYS (logb, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (logb);
+_GL_CXXALIASWARN1 (logb, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef logb
@@ -1739,7 +1833,7 @@ _GL_CXXALIAS_RPL (modf, double, (double x, double *iptr));
_GL_CXXALIAS_SYS (modf, double, (double x, double *iptr));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (modf);
+_GL_CXXALIASWARN1 (modf, double, (double x, double *iptr));
# endif
#elif defined GNULIB_POSIXCHECK
# undef modf
@@ -1766,7 +1860,9 @@ _GL_FUNCDECL_SYS (modfl, long double, (long double x, long double *iptr)
# endif
_GL_CXXALIAS_SYS (modfl, long double, (long double x, long double *iptr));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (modfl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef modfl
# if HAVE_RAW_DECL_MODFL
@@ -1830,7 +1926,7 @@ _GL_FUNCDECL_SYS (remainder, double, (double x, double y));
_GL_CXXALIAS_SYS (remainder, double, (double x, double y));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (remainder);
+_GL_CXXALIASWARN1 (remainder, double, (double x, double y));
# endif
#elif defined GNULIB_POSIXCHECK
# undef remainder
@@ -1887,7 +1983,7 @@ _GL_FUNCDECL_SYS (rint, double, (double x));
# endif
_GL_CXXALIAS_SYS (rint, double, (double x));
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (rint);
+_GL_CXXALIASWARN1 (rint, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef rint
@@ -1959,7 +2055,7 @@ _GL_FUNCDECL_SYS (round, double, (double x));
_GL_CXXALIAS_SYS (round, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (round);
+_GL_CXXALIASWARN1 (round, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef round
@@ -2026,7 +2122,9 @@ _GL_WARN_ON_USE (sinf, "sinf is unportable - "
_GL_FUNCDECL_SYS (sinl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (sinl, long double, (long double x));
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (sinl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef sinl
# if HAVE_RAW_DECL_SINL
@@ -2100,7 +2198,9 @@ _GL_FUNCDECL_SYS (sqrtl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (sqrtl, long double, (long double x));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (sqrtl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef sqrtl
# if HAVE_RAW_DECL_SQRTL
@@ -2140,7 +2240,9 @@ _GL_WARN_ON_USE (tanf, "tanf is unportable - "
_GL_FUNCDECL_SYS (tanl, long double, (long double x));
# endif
_GL_CXXALIAS_SYS (tanl, long double, (long double x));
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (tanl);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef tanl
# if HAVE_RAW_DECL_TANL
@@ -2213,7 +2315,7 @@ _GL_FUNCDECL_SYS (trunc, double, (double x));
_GL_CXXALIAS_SYS (trunc, double, (double x));
# endif
# if __GLIBC__ >= 2
-_GL_CXXALIASWARN (trunc);
+_GL_CXXALIASWARN1 (trunc, double, (double x));
# endif
#elif defined GNULIB_POSIXCHECK
# undef trunc
@@ -2247,6 +2349,55 @@ _GL_WARN_ON_USE (truncl, "truncl is unportable - "
#endif
+#if @GNULIB_MDA_Y0@
+/* On native Windows, map 'y0' to '_y0', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::y0 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef y0
+# define y0 _y0
+# endif
+_GL_CXXALIAS_MDA (y0, double, (double x));
+# else
+_GL_CXXALIAS_SYS (y0, double, (double x));
+# endif
+_GL_CXXALIASWARN (y0);
+#endif
+
+#if @GNULIB_MDA_Y1@
+/* On native Windows, map 'y1' to '_y1', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::y1 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef y1
+# define y1 _y1
+# endif
+_GL_CXXALIAS_MDA (y1, double, (double x));
+# else
+_GL_CXXALIAS_SYS (y1, double, (double x));
+# endif
+_GL_CXXALIASWARN (y1);
+#endif
+
+#if @GNULIB_MDA_YN@
+/* On native Windows, map 'yn' to '_yn', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::yn always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef yn
+# define yn _yn
+# endif
+_GL_CXXALIAS_MDA (yn, double, (int n, double x));
+# else
+_GL_CXXALIAS_SYS (yn, double, (int n, double x));
+# endif
+_GL_CXXALIASWARN (yn);
+#endif
+
+
/* Definitions of function-like macros come here, after the function
declarations. */
@@ -2266,7 +2417,7 @@ _GL_EXTERN_C int gl_isfinitel (long double x);
# if defined isfinite || defined GNULIB_NAMESPACE
_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
# undef isfinite
-# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX))
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__)))
/* This platform's <cmath> possibly defines isfinite through a set of inline
functions. */
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, rpl_isfinite, bool)
@@ -2300,7 +2451,7 @@ _GL_EXTERN_C int gl_isinfl (long double x);
# if defined isinf || defined GNULIB_NAMESPACE
_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf)
# undef isinf
-# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__))
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
/* This platform's <cmath> possibly defines isinf through a set of inline
functions. */
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf, rpl_isinf, bool)
@@ -2324,10 +2475,11 @@ _GL_WARN_REAL_FLOATING_DECL (isinf);
# if @HAVE_ISNANF@
/* The original <math.h> included above provides a declaration of isnan macro
or (older) isnanf function. */
-# if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanf))
- /* GCC 4.0 and newer provides three built-ins for isnan. */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+ /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
+ GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't. */
# undef isnanf
-# define isnanf(x) __builtin_isnanf ((float)(x))
+# define isnanf(x) __builtin_isnan ((float)(x))
# elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
@@ -2347,8 +2499,8 @@ _GL_EXTERN_C int isnanf (float x);
# if @HAVE_ISNAND@
/* The original <math.h> included above provides a declaration of isnan
macro. */
-# if __GNUC__ >= 4
- /* GCC 4.0 and newer provides three built-ins for isnan. */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+ /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. */
# undef isnand
# define isnand(x) __builtin_isnan ((double)(x))
# else
@@ -2368,10 +2520,11 @@ _GL_EXTERN_C int isnand (double x);
# if @HAVE_ISNANL@
/* The original <math.h> included above provides a declaration of isnan
macro or (older) isnanl function. */
-# if __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl))
- /* GCC 4.0 and newer provides three built-ins for isnan. */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+ /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
+ GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't. */
# undef isnanl
-# define isnanl(x) __builtin_isnanl ((long double)(x))
+# define isnanl(x) __builtin_isnan ((long double)(x))
# elif defined isnan
# undef isnanl
# define isnanl(x) isnan ((long double)(x))
@@ -2391,20 +2544,20 @@ _GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST;
isnanf.h (e.g.) here, because those may end up being macros
that recursively expand back to isnan. So use the gnulib
replacements for them directly. */
-# if @HAVE_ISNANF@ && __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanf))
-# define gl_isnan_f(x) __builtin_isnanf ((float)(x))
+# if @HAVE_ISNANF@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
+# define gl_isnan_f(x) __builtin_isnan ((float)(x))
# else
_GL_EXTERN_C int rpl_isnanf (float x);
# define gl_isnan_f(x) rpl_isnanf (x)
# endif
-# if @HAVE_ISNAND@ && __GNUC__ >= 4
+# if @HAVE_ISNAND@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
# define gl_isnan_d(x) __builtin_isnan ((double)(x))
# else
_GL_EXTERN_C int rpl_isnand (double x);
# define gl_isnan_d(x) rpl_isnand (x)
# endif
-# if @HAVE_ISNANL@ && __GNUC__ >= 4 && (!defined __clang__ || __has_builtin (__builtin_isnanl))
-# define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
+# if @HAVE_ISNANL@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
+# define gl_isnan_l(x) __builtin_isnan ((long double)(x))
# else
_GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
# define gl_isnan_l(x) rpl_isnanl (x)
@@ -2414,18 +2567,18 @@ _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
(sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
gl_isnan_f (x))
-# elif __GNUC__ >= 4 && (!defined __clang__ || (__has_builtin (__builtin_isnanf) && __has_builtin (__builtin_isnanl)))
+# elif (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnan
# define isnan(x) \
- (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
+ (sizeof (x) == sizeof (long double) ? __builtin_isnan ((long double)(x)) : \
sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
- __builtin_isnanf ((float)(x)))
+ __builtin_isnan ((float)(x)))
# endif
# ifdef __cplusplus
# if defined isnan || defined GNULIB_NAMESPACE
_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
# undef isnan
-# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__))
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || (defined __FreeBSD__ && __clang_major__ < 7) || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
/* This platform's <cmath> possibly defines isnan through a set of inline
functions. */
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool)
@@ -2450,10 +2603,10 @@ _GL_WARN_REAL_FLOATING_DECL (isnan);
#if @GNULIB_SIGNBIT@
-# if (@REPLACE_SIGNBIT_USING_GCC@ \
+# if (@REPLACE_SIGNBIT_USING_BUILTINS@ \
&& (!defined __cplusplus || __cplusplus < 201103))
# undef signbit
- /* GCC 4.0 and newer provides three built-ins for signbit. */
+ /* GCC >= 4.0 and clang provide three built-ins for signbit. */
# define signbit(x) \
(sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
@@ -2464,7 +2617,7 @@ _GL_WARN_REAL_FLOATING_DECL (isnan);
_GL_EXTERN_C int gl_signbitf (float arg);
_GL_EXTERN_C int gl_signbitd (double arg);
_GL_EXTERN_C int gl_signbitl (long double arg);
-# if __GNUC__ >= 2 && !defined __STRICT_ANSI__
+# if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__
# define _GL_NUM_UINT_WORDS(type) \
((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
# if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
@@ -2508,7 +2661,7 @@ _GL_EXTERN_C int gl_signbitl (long double arg);
# if defined signbit || defined GNULIB_NAMESPACE
_GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit)
# undef signbit
-# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX))
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__)))
/* This platform's <cmath> possibly defines signbit through a set of inline
functions. */
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, rpl_signbit, bool)
@@ -2529,4 +2682,5 @@ _GL_WARN_REAL_FLOATING_DECL (signbit);
_GL_INLINE_HEADER_END
#endif /* _@GUARD_PREFIX@_MATH_H */
+#endif /* _GL_INCLUDING_MATH_H */
#endif /* _@GUARD_PREFIX@_MATH_H */