]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Stop using _GLIBCXX_USE_C99_MATH_TR1 in <cmath>
authorJonathan Wakely <jwakely@redhat.com>
Fri, 12 May 2023 23:57:15 +0000 (00:57 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 31 May 2023 20:01:16 +0000 (21:01 +0100)
Similar to the three commits r14-908, r14-909 and r14-910, the
_GLIBCXX_USE_C99_MATH_TR1 macro is misleading when it is also used for
<cmath>, not only for <tr1/cmath> headers. It is also wrong, because the
configure checks for TR1 use -std=c++98 and a target might define the
C99 features for C++11 but not for C++98.

Add separate configure checks for the <math.h> functions using
-std=c++11 for the checks. Use the new macro defined by those checks in
the C++11-specific parts of <cmath>, and in <complex>, <random> etc.

The check that defines _GLIBCXX_NO_C99_ROUNDING_FUNCS is only needed for
the C++11 <cmath> checks, so remove that from GLIBCXX_CHECK_C99_TR1 and
only do it for GLIBCXX_ENABLE_C99.

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_ENABLE_C99): Add checks for C99 math
functions and define _GLIBCXX_USE_C99_MATH_FUNCS. Move checks
for C99 rounding functions to here.
(GLIBCXX_CHECK_C99_TR1): Remove checks for C99 rounding
functions from here.
* config.h.in: Regenerate.
* configure: Regenerate.
* include/bits/random.h: Use _GLIBCXX_USE_C99_MATH_FUNCS instead
of _GLIBCXX_USE_C99_MATH_TR1.
* include/bits/random.tcc: Likewise.
* include/c_compatibility/math.h: Likewise.
* include/c_global/cmath: Likewise.
* include/ext/random: Likewise.
* include/ext/random.tcc: Likewise.
* include/std/complex: Likewise.
* testsuite/20_util/from_chars/4.cc: Likewise.
* testsuite/20_util/from_chars/8.cc: Likewise.
* testsuite/26_numerics/complex/proj.cc: Likewise.
* testsuite/26_numerics/headers/cmath/60401.cc: Likewise.
* testsuite/26_numerics/headers/cmath/types_std_c++0x.cc:
Likewise.
* testsuite/lib/libstdc++.exp (check_v3_target_cstdint):
Likewise.
* testsuite/util/testsuite_random.h: Likewise.

17 files changed:
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/configure
libstdc++-v3/include/bits/random.h
libstdc++-v3/include/bits/random.tcc
libstdc++-v3/include/c_compatibility/math.h
libstdc++-v3/include/c_global/cmath
libstdc++-v3/include/ext/random
libstdc++-v3/include/ext/random.tcc
libstdc++-v3/include/std/complex
libstdc++-v3/testsuite/20_util/from_chars/4.cc
libstdc++-v3/testsuite/20_util/from_chars/8.cc
libstdc++-v3/testsuite/26_numerics/complex/proj.cc
libstdc++-v3/testsuite/26_numerics/headers/cmath/60401.cc
libstdc++-v3/testsuite/26_numerics/headers/cmath/types_std_c++0x.cc
libstdc++-v3/testsuite/lib/libstdc++.exp
libstdc++-v3/testsuite/util/testsuite_random.h

index ca776974832d9d42c73052aa5311bd59e9463029..66194071b20d7de49bf3e324f2b8b7d202351b06 100644 (file)
@@ -1245,8 +1245,8 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [
                imported in <cinttypes> in namespace std in C++11.])
     fi
 
-    # Check for the existence of <math.h> functions used if C99 is enabled.
-    AC_CACHE_CHECK([for ISO C99 support in <math.h> for C++11],
+    # Check for the existence of <math.h> generic macros used if C99 is enabled.
+    AC_CACHE_CHECK([for ISO C99 generic macro support in <math.h> for C++11],
     glibcxx_cv_c99_math_cxx11, [
       GCC_TRY_COMPILE_OR_LINK(
         [#include <math.h>
@@ -1269,10 +1269,165 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [
     ])
     if test x"$glibcxx_cv_c99_math_cxx11" = x"yes"; then
       AC_DEFINE(_GLIBCXX11_USE_C99_MATH, 1,
-        [Define if C99 functions or macros in <math.h> should be imported
+        [Define if C99 generic macros in <math.h> should be imported
         in <cmath> in namespace std for C++11.])
     fi
 
+    # Check for the existence of <math.h> functions.
+    AC_CACHE_CHECK([for ISO C99 function support for C++11 in <math.h>],
+    glibcxx_cv_c99_math_funcs, [
+    AC_TRY_COMPILE([#include <math.h>],
+                  [// Types
+                   typedef double_t  my_double_t;
+                   typedef float_t   my_float_t;
+                   // Hyperbolic
+                   acosh(0.0);
+                   acoshf(0.0f);
+                   acoshl(0.0l);
+                   asinh(0.0);
+                   asinhf(0.0f);
+                   asinhl(0.0l);
+                   atanh(0.0);
+                   atanhf(0.0f);
+                   atanhl(0.0l);
+                   // Exponential and logarithmic
+                   exp2(0.0);
+                   exp2f(0.0f);
+                   exp2l(0.0l);
+                   expm1(0.0);
+                   expm1f(0.0f);
+                   expm1l(0.0l);
+                   ilogb(0.0);
+                   ilogbf(0.0f);
+                   ilogbl(0.0l);
+                   log1p(0.0);
+                   log1pf(0.0f);
+                   log1pl(0.0l);
+                   log2(0.0);
+                   log2f(0.0f);
+                   log2l(0.0l);
+                   logb(0.0);
+                   logbf(0.0f);
+                   logbl(0.0l);
+                   scalbln(0.0, 0l);
+                   scalblnf(0.0f, 0l);
+                   scalblnl(0.0l, 0l);
+                   scalbn(0.0, 0);
+                   scalbnf(0.0f, 0);
+                   scalbnl(0.0l, 0);
+                   // Power and absolute-value
+                   cbrt(0.0);
+                   cbrtf(0.0f);
+                   cbrtl(0.0l);
+                   hypot(0.0, 0.0);
+                   hypotf(0.0f, 0.0f);
+                   hypotl(0.0l, 0.0l);
+                   // Error and gamma
+                   erf(0.0);
+                   erff(0.0f);
+                   erfl(0.0l);
+                   erfc(0.0);
+                   erfcf(0.0f);
+                   erfcl(0.0l);
+                   lgamma(0.0);
+                   lgammaf(0.0f);
+                   lgammal(0.0l);
+                   tgamma(0.0);
+                   tgammaf(0.0f);
+                   tgammal(0.0l);
+                   // Nearest integer
+                   nearbyint(0.0);
+                   nearbyintf(0.0f);
+                   nearbyintl(0.0l);
+                   rint(0.0);
+                   rintf(0.0f);
+                   rintl(0.0l);
+                   round(0.0);
+                   roundf(0.0f);
+                   roundl(0.0l);
+                   lrint(0.0);
+                   lrintf(0.0f);
+                   lrintl(0.0l);
+                   lround(0.0);
+                   lroundf(0.0f);
+                   lroundl(0.0l);
+                   #ifndef __APPLE__ /* see below */
+                   llrint(0.0);
+                   llrintf(0.0f);
+                   llrintl(0.0l);
+                   llround(0.0);
+                   llroundf(0.0f);
+                   llroundl(0.0l);
+                   #endif
+                   trunc(0.0);
+                   truncf(0.0f);
+                   truncl(0.0l);
+                   // Remainder
+                   remainder(0.0, 0.0);
+                   remainderf(0.0f, 0.0f);
+                   remainderl(0.0l, 0.0l);
+                   remquo(0.0, 0.0, 0);
+                   remquof(0.0f, 0.0f, 0);
+                   remquol(0.0l, 0.0l, 0);
+                   // Manipulation
+                   copysign(0.0, 0.0);
+                   copysignf(0.0f, 0.0f);
+                   copysignl(0.0l, 0.0l);
+                   nan("");
+                   nanf("");
+                   nanl("");
+                   nextafter(0.0, 0.0);
+                   nextafterf(0.0f, 0.0f);
+                   nextafterl(0.0l, 0.0l);
+                   nexttoward(0.0, 0.0);
+                   nexttowardf(0.0f, 0.0f);
+                   nexttowardl(0.0l, 0.0l);
+                   // Max, min, positive difference
+                   fdim(0.0, 0.0);
+                   fdimf(0.0f, 0.0f);
+                   fdiml(0.0l, 0.0l);
+                   fmax(0.0, 0.0);
+                   fmaxf(0.0f, 0.0f);
+                   fmaxl(0.0l, 0.0l);
+                   fmin(0.0, 0.0);
+                   fminf(0.0f, 0.0f);
+                   fminl(0.0l, 0.0l);
+                   // FP Multiply-add
+                   fma(0.0, 0.0, 0.0);
+                   fmaf(0.0f, 0.0f, 0.0f);
+                   fmal(0.0l, 0.0l, 0.0l);
+                  ],
+                  [glibcxx_cv_c99_math_funcs=yes],
+                  [glibcxx_cv_c99_math_funcs=no])
+    ])
+    if test x"$glibcxx_cv_c99_math_funcs" = x"yes"; then
+      AC_DEFINE(_GLIBCXX_USE_C99_MATH_FUNCS, 1,
+               [Define if C99 functions in <math.h> should be imported
+               in <cmath> in namespace std for C++11.])
+
+      case "${target_os}" in
+       darwin*)
+         AC_CACHE_CHECK([for ISO C99 rounding functions in <math.h>],
+           glibcxx_cv_c99_math_llround, [
+           AC_TRY_COMPILE([#include <math.h>],
+                  [llrint(0.0);
+                   llrintf(0.0f);
+                   llrintl(0.0l);
+                   llround(0.0);
+                   llroundf(0.0f);
+                   llroundl(0.0l);
+                  ],
+                  [glibcxx_cv_c99_math_llround=yes],
+                  [glibcxx_cv_c99_math_llround=no])
+           ])
+         ;;
+      esac
+      if test x"$glibcxx_cv_c99_math_llround" = x"no"; then
+       AC_DEFINE(_GLIBCXX_NO_C99_ROUNDING_FUNCS, 1,
+                 [Define if C99 llrint and llround functions are missing from <math.h>.])
+      fi
+    fi
+
     # Check for the existence of <complex.h> complex math functions.
     # This is necessary even though libstdc++ uses the builtin versions
     # of these functions, because if the builtin cannot be used, a reference
@@ -2152,28 +2307,6 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
     AC_DEFINE(_GLIBCXX_USE_C99_MATH_TR1, 1,
              [Define if C99 functions or macros in <math.h> should be imported
              in <tr1/cmath> in namespace std::tr1.])
-
-    case "${target_os}" in
-      darwin*)
-       AC_CACHE_CHECK([for ISO C99 rounding functions in <math.h>],
-         glibcxx_cv_c99_math_llround, [
-          AC_TRY_COMPILE([#include <math.h>],
-                [llrint(0.0);
-                 llrintf(0.0f);
-                 llrintl(0.0l);
-                 llround(0.0);
-                 llroundf(0.0f);
-                 llroundl(0.0l);
-                ],
-                [glibcxx_cv_c99_math_llround=yes],
-                [glibcxx_cv_c99_math_llround=no])
-          ])
-        ;;
-    esac
-    if test x"$glibcxx_cv_c99_math_llround" = x"no"; then
-      AC_DEFINE(_GLIBCXX_NO_C99_ROUNDING_FUNCS, 1,
-               [Define if C99 llrint and llround functions are missing from <math.h>.])
-    fi
   fi
 
   # Check for the existence of <inttypes.h> functions (NB: doesn't make
index bbb2613ff6934f853526e37f5e893b2669ffce60..4fbf5ef86b90d35cc4f8cf414caea27ca89af764 100644 (file)
    C99 library functions to be present. */
 #undef _GLIBCXX11_USE_C99_COMPLEX
 
-/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
-   in namespace std for C++11. */
+/* Define if C99 generic macros in <math.h> should be imported in <cmath> in
+   namespace std for C++11. */
 #undef _GLIBCXX11_USE_C99_MATH
 
 /* Define if C99 functions or macros in <stdio.h> should be imported in
    <tr1/cinttypes> in namespace std::tr1. */
 #undef _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
 
+/* Define if C99 functions in <math.h> should be imported in <cmath> in
+   namespace std for C++11. */
+#undef _GLIBCXX_USE_C99_MATH_FUNCS
+
 /* Define if C99 functions or macros in <math.h> should be imported in
    <tr1/cmath> in namespace std::tr1. */
 #undef _GLIBCXX_USE_C99_MATH_TR1
index f573dfced2e848d813abb6f96bcd18c2facfd371..ba328a64be20b66d73ab9157df46005eeb4bda2e 100755 (executable)
@@ -18187,9 +18187,9 @@ $as_echo "#define _GLIBCXX_USE_C99_INTTYPES_WCHAR_T 1" >>confdefs.h
 
     fi
 
-    # Check for the existence of <math.h> functions used if C99 is enabled.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <math.h> for C++11" >&5
-$as_echo_n "checking for ISO C99 support in <math.h> for C++11... " >&6; }
+    # Check for the existence of <math.h> generic macros used if C99 is enabled.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 generic macro support in <math.h> for C++11" >&5
+$as_echo_n "checking for ISO C99 generic macro support in <math.h> for C++11... " >&6; }
 if ${glibcxx_cv_c99_math_cxx11+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -18275,6 +18275,202 @@ $as_echo "#define _GLIBCXX11_USE_C99_MATH 1" >>confdefs.h
 
     fi
 
+    # Check for the existence of <math.h> functions.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 function support for C++11 in <math.h>" >&5
+$as_echo_n "checking for ISO C99 function support for C++11 in <math.h>... " >&6; }
+if ${glibcxx_cv_c99_math_funcs+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+int
+main ()
+{
+// Types
+                   typedef double_t  my_double_t;
+                   typedef float_t   my_float_t;
+                   // Hyperbolic
+                   acosh(0.0);
+                   acoshf(0.0f);
+                   acoshl(0.0l);
+                   asinh(0.0);
+                   asinhf(0.0f);
+                   asinhl(0.0l);
+                   atanh(0.0);
+                   atanhf(0.0f);
+                   atanhl(0.0l);
+                   // Exponential and logarithmic
+                   exp2(0.0);
+                   exp2f(0.0f);
+                   exp2l(0.0l);
+                   expm1(0.0);
+                   expm1f(0.0f);
+                   expm1l(0.0l);
+                   ilogb(0.0);
+                   ilogbf(0.0f);
+                   ilogbl(0.0l);
+                   log1p(0.0);
+                   log1pf(0.0f);
+                   log1pl(0.0l);
+                   log2(0.0);
+                   log2f(0.0f);
+                   log2l(0.0l);
+                   logb(0.0);
+                   logbf(0.0f);
+                   logbl(0.0l);
+                   scalbln(0.0, 0l);
+                   scalblnf(0.0f, 0l);
+                   scalblnl(0.0l, 0l);
+                   scalbn(0.0, 0);
+                   scalbnf(0.0f, 0);
+                   scalbnl(0.0l, 0);
+                   // Power and absolute-value
+                   cbrt(0.0);
+                   cbrtf(0.0f);
+                   cbrtl(0.0l);
+                   hypot(0.0, 0.0);
+                   hypotf(0.0f, 0.0f);
+                   hypotl(0.0l, 0.0l);
+                   // Error and gamma
+                   erf(0.0);
+                   erff(0.0f);
+                   erfl(0.0l);
+                   erfc(0.0);
+                   erfcf(0.0f);
+                   erfcl(0.0l);
+                   lgamma(0.0);
+                   lgammaf(0.0f);
+                   lgammal(0.0l);
+                   tgamma(0.0);
+                   tgammaf(0.0f);
+                   tgammal(0.0l);
+                   // Nearest integer
+                   nearbyint(0.0);
+                   nearbyintf(0.0f);
+                   nearbyintl(0.0l);
+                   rint(0.0);
+                   rintf(0.0f);
+                   rintl(0.0l);
+                   round(0.0);
+                   roundf(0.0f);
+                   roundl(0.0l);
+                   lrint(0.0);
+                   lrintf(0.0f);
+                   lrintl(0.0l);
+                   lround(0.0);
+                   lroundf(0.0f);
+                   lroundl(0.0l);
+                   #ifndef __APPLE__ /* see below */
+                   llrint(0.0);
+                   llrintf(0.0f);
+                   llrintl(0.0l);
+                   llround(0.0);
+                   llroundf(0.0f);
+                   llroundl(0.0l);
+                   #endif
+                   trunc(0.0);
+                   truncf(0.0f);
+                   truncl(0.0l);
+                   // Remainder
+                   remainder(0.0, 0.0);
+                   remainderf(0.0f, 0.0f);
+                   remainderl(0.0l, 0.0l);
+                   remquo(0.0, 0.0, 0);
+                   remquof(0.0f, 0.0f, 0);
+                   remquol(0.0l, 0.0l, 0);
+                   // Manipulation
+                   copysign(0.0, 0.0);
+                   copysignf(0.0f, 0.0f);
+                   copysignl(0.0l, 0.0l);
+                   nan("");
+                   nanf("");
+                   nanl("");
+                   nextafter(0.0, 0.0);
+                   nextafterf(0.0f, 0.0f);
+                   nextafterl(0.0l, 0.0l);
+                   nexttoward(0.0, 0.0);
+                   nexttowardf(0.0f, 0.0f);
+                   nexttowardl(0.0l, 0.0l);
+                   // Max, min, positive difference
+                   fdim(0.0, 0.0);
+                   fdimf(0.0f, 0.0f);
+                   fdiml(0.0l, 0.0l);
+                   fmax(0.0, 0.0);
+                   fmaxf(0.0f, 0.0f);
+                   fmaxl(0.0l, 0.0l);
+                   fmin(0.0, 0.0);
+                   fminf(0.0f, 0.0f);
+                   fminl(0.0l, 0.0l);
+                   // FP Multiply-add
+                   fma(0.0, 0.0, 0.0);
+                   fmaf(0.0f, 0.0f, 0.0f);
+                   fmal(0.0l, 0.0l, 0.0l);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_c99_math_funcs=yes
+else
+  glibcxx_cv_c99_math_funcs=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_math_funcs" >&5
+$as_echo "$glibcxx_cv_c99_math_funcs" >&6; }
+    if test x"$glibcxx_cv_c99_math_funcs" = x"yes"; then
+
+$as_echo "#define _GLIBCXX_USE_C99_MATH_FUNCS 1" >>confdefs.h
+
+
+      case "${target_os}" in
+       darwin*)
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 rounding functions in <math.h>" >&5
+$as_echo_n "checking for ISO C99 rounding functions in <math.h>... " >&6; }
+if ${glibcxx_cv_c99_math_llround+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+int
+main ()
+{
+llrint(0.0);
+                   llrintf(0.0f);
+                   llrintl(0.0l);
+                   llround(0.0);
+                   llroundf(0.0f);
+                   llroundl(0.0l);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_c99_math_llround=yes
+else
+  glibcxx_cv_c99_math_llround=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_math_llround" >&5
+$as_echo "$glibcxx_cv_c99_math_llround" >&6; }
+         ;;
+      esac
+      if test x"$glibcxx_cv_c99_math_llround" = x"no"; then
+
+$as_echo "#define _GLIBCXX_NO_C99_ROUNDING_FUNCS 1" >>confdefs.h
+
+      fi
+    fi
+
     # Check for the existence of <complex.h> complex math functions.
     # This is necessary even though libstdc++ uses the builtin versions
     # of these functions, because if the builtin cannot be used, a reference
@@ -20507,49 +20703,6 @@ $as_echo "$glibcxx_cv_c99_math_tr1" >&6; }
 
 $as_echo "#define _GLIBCXX_USE_C99_MATH_TR1 1" >>confdefs.h
 
-
-    case "${target_os}" in
-      darwin*)
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 rounding functions in <math.h>" >&5
-$as_echo_n "checking for ISO C99 rounding functions in <math.h>... " >&6; }
-if ${glibcxx_cv_c99_math_llround+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-int
-main ()
-{
-llrint(0.0);
-                 llrintf(0.0f);
-                 llrintl(0.0l);
-                 llround(0.0);
-                 llroundf(0.0f);
-                 llroundl(0.0l);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  glibcxx_cv_c99_math_llround=yes
-else
-  glibcxx_cv_c99_math_llround=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_math_llround" >&5
-$as_echo "$glibcxx_cv_c99_math_llround" >&6; }
-        ;;
-    esac
-    if test x"$glibcxx_cv_c99_math_llround" = x"no"; then
-
-$as_echo "#define _GLIBCXX_NO_C99_ROUNDING_FUNCS 1" >>confdefs.h
-
-    fi
   fi
 
   # Check for the existence of <inttypes.h> functions (NB: doesn't make
index f77005adec542bdd33c28fb4d18ce372eb708987..58b5dd77d9ebd078a2000b24d4b08a77deec14d0 100644 (file)
@@ -3901,7 +3901,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        double _M_p;
 
        double _M_q;
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
        double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
               _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
 #endif
@@ -4015,7 +4015,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        friend bool
         operator==(const binomial_distribution& __d1,
                   const binomial_distribution& __d2)
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
        { return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
 #else
         { return __d1._M_param == __d2._M_param; }
@@ -4068,7 +4068,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       param_type _M_param;
 
-      // NB: Unused when _GLIBCXX_USE_C99_MATH_TR1 is undefined.
+      // NB: Unused when _GLIBCXX_USE_C99_MATH_FUNCS is undefined.
       std::normal_distribution<double> _M_nd;
     };
 
@@ -4595,7 +4595,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        double _M_mean;
 
        double _M_lm_thr;
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
        double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
 #endif
       };
@@ -4700,7 +4700,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       friend bool
       operator==(const poisson_distribution& __d1,
                 const poisson_distribution& __d2)
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
       { return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
 #else
       { return __d1._M_param == __d2._M_param; }
@@ -4746,7 +4746,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       param_type _M_param;
 
-      // NB: Unused when _GLIBCXX_USE_C99_MATH_TR1 is undefined.
+      // NB: Unused when _GLIBCXX_USE_C99_MATH_FUNCS is undefined.
       std::normal_distribution<double> _M_nd;
     };
 
index f092b5cd4cbcd29c360c6c10c0284a63b94e9fb3..24a5987db0df7fe13c60d300fbdd60e7ecf4843f 100644 (file)
@@ -1267,7 +1267,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     poisson_distribution<_IntType>::param_type::
     _M_initialize()
     {
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
       if (_M_mean >= 12)
        {
          const double __m = std::floor(_M_mean);
@@ -1295,7 +1295,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /**
    * A rejection algorithm when mean >= 12 and a simple method based
    * upon the multiplication of uniform random variates otherwise.
-   * NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1
+   * NB: The former is available only if _GLIBCXX_USE_C99_MATH_FUNCS
    * is defined.
    *
    * Reference:
@@ -1311,7 +1311,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
        __detail::_Adaptor<_UniformRandomNumberGenerator, double>
          __aurng(__urng);
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
        if (__param.mean() >= 12)
          {
            double __x;
@@ -1479,7 +1479,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       _M_easy = true;
 
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
       if (_M_t * __p12 >= 8)
        {
          _M_easy = false;
@@ -1550,7 +1550,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /**
    * A rejection algorithm when t * p >= 8 and a simple waiting time
    * method - the second in the referenced book - otherwise.
-   * NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1
+   * NB: The former is available only if _GLIBCXX_USE_C99_MATH_FUNCS
    * is defined.
    *
    * Reference:
@@ -1571,7 +1571,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        __detail::_Adaptor<_UniformRandomNumberGenerator, double>
          __aurng(__urng);
 
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
        if (!__param._M_easy)
          {
            double __x;
@@ -3367,7 +3367,7 @@ namespace __detail
       __ret = __sum / __tmp;
       if (__builtin_expect(__ret >= _RealType(1), 0))
        {
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
          __ret = std::nextafter(_RealType(1), _RealType(0));
 #else
          __ret = _RealType(1)
index 1206117b74189d90d203d6decf827733833b2b75..cedb11d0f85b3e5b8820e330e04d9a63d3ca96fc 100644 (file)
@@ -74,7 +74,7 @@ using std::islessgreater;
 using std::isunordered;
 #endif
 
-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99_MATH_TR1)
+#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99_MATH_FUNCS)
 using std::acosh;
 using std::asinh;
 using std::atanh;
@@ -109,7 +109,7 @@ using std::scalbln;
 using std::scalbn;
 using std::tgamma;
 using std::trunc;
-#endif // C++11 && _GLIBCXX_USE_C99_MATH_TR1
+#endif // C++11 && _GLIBCXX_USE_C99_MATH_FUNCS
 
 // The mathematical special functions are only added to the global namespace
 // by IS 29124, but not by C++17.
index 4dc029e4e26d727cd92048d4e098ca342c48dade..c80ee7c8d721c8e7c43bee2e15f8886ab6b95935 100644 (file)
@@ -1767,7 +1767,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 #if __cplusplus >= 201103L
 
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
 
 #undef acosh
 #undef acoshf
@@ -3539,7 +3539,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 #endif
 
-#endif // _GLIBCXX_USE_C99_MATH_TR1
+#endif // _GLIBCXX_USE_C99_MATH_FUNCS
 #endif // C++11
 
 #if __cplusplus >= 201703L
index 62acb67e05b04c703c543d4e9f9c30cef18a0780..5ae085a971fb488e40e9e4d824fc1b89d655d466 100644 (file)
@@ -1116,7 +1116,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        {
          result_type __x = this->_M_ndx(__urng);
          result_type __y = this->_M_ndy(__urng);
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
          return std::hypot(__x, __y);
 #else
          return std::sqrt(__x * __x + __y * __y);
@@ -1132,7 +1132,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            __px(__p.nu(), __p.sigma()), __py(result_type(0), __p.sigma());
          result_type __x = this->_M_ndx(__px, __urng);
          result_type __y = this->_M_ndy(__py, __urng);
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
          return std::hypot(__x, __y);
 #else
          return std::sqrt(__x * __x + __y * __y);
index df80422bc8b6160e16f77404302c5b12acdd7c80..87ecce7b0d3610082e29f358f21e6305e49ff8bf 100644 (file)
@@ -740,7 +740,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
              __px(__p.nu(), __p.sigma()), __py(result_type(0), __p.sigma());
            result_type __x = this->_M_ndx(__px, __urng);
            result_type __y = this->_M_ndy(__py, __urng);
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
            *__f++ = std::hypot(__x, __y);
 #else
            *__f++ = std::sqrt(__x * __x + __y * __y);
@@ -1287,7 +1287,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          }
 
        result_type __res = std::acos(__f);
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
        __res = std::copysign(__res, __aurng() - result_type(0.5));
 #else
        if (__aurng() < result_type(0.5))
@@ -1623,7 +1623,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            }
          while (__sq == _RealType(0) || __sq > _RealType(1));
 
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
          // Yes, we do not just use sqrt(__sq) because hypot() is more
          // accurate.
          auto __norm = std::hypot(__ret[0], __ret[1]);
index 40fc062e53db87baa887545fdbf1b163b304178f..f01a3af43718bf35bb2fadad87adbef206175181 100644 (file)
@@ -2534,7 +2534,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { return __complex_proj(__z.__rep()); }
 #endif
 
-#elif defined _GLIBCXX_USE_C99_MATH_TR1
+#elif defined _GLIBCXX_USE_C99_MATH_FUNCS
   inline complex<float>
   __complex_proj(const complex<float>& __z)
   {
index 63a32b511be4ed67c1a40a9d9d62a0fc01ce5b01..206e18daeb229121a43f52b28fbf15d02a10f194 100644 (file)
@@ -301,7 +301,7 @@ test_max_mantissa()
 
   if (Float_limits::is_iec559 && Float_limits::digits < UInt_limits::digits)
   {
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
     std::printf("Testing %d-bit float, using %zu-bit integer\n",
        Float_limits::digits + (int)std::log2(Float_limits::max_exponent) + 1,
        sizeof(UIntT) * __CHAR_BIT__);
index 865679cef8b451b6661b59b6764c7ec63549bd70..d37460a655c8b010794a368cf5101bd6862ec81d 100644 (file)
@@ -286,7 +286,7 @@ test_max_mantissa()
 
   if (Float_limits::is_iec559 && Float_limits::digits < UInt_limits::digits)
   {
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
     std::printf("Testing %d-bit float, using %zu-bit integer\n",
        Float_limits::digits + (int)std::log2(Float_limits::max_exponent) + 1,
        sizeof(UIntT) * __CHAR_BIT__);
index b064e838b8e7a2452d01ddec64cea3abb3776d5f..b23b4a904dd6137a0cab4c0c1f33b7492bb64e3f 100644 (file)
@@ -23,7 +23,7 @@
 
 namespace test
 {
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
   using std::copysign;
 #else
   bool copysign(float x, float y)
@@ -405,7 +405,7 @@ main()
      normal ways to skip tests may not work: we don't have a test for
      C99_COMPLEX, and these macros may vary depending on -std=*, but
      macro tests wouldn't take them into account.  */
-#if ! (_GLIBCXX_USE_C99_COMPLEX || _GLIBCXX_USE_C99_MATH_TR1)
+#if ! (_GLIBCXX_USE_C99_COMPLEX || _GLIBCXX_USE_C99_MATH_FUNCS)
   if (true)
     return 0;
 #endif
index 5adcf993dc0b48523943cc388ac52ddedf2681aa..1351bbaf9c87adcf5a4cdb5e5e48c363a283b580 100644 (file)
@@ -28,7 +28,7 @@ namespace test
 
   F<float(float)>abs = ::abs;
 
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
   F<float(float)>              acosh           = ::acosh;
   F<float(float)>              asinh           = ::asinh;
   F<float(float)>              atanh           = ::atanh;
index 13c1d0d0cd4ff303f6f08bffe064e025d06eceba..f81f08f8b3e73768f1425abf9d0d6c094c075d99 100644 (file)
@@ -21,7 +21,7 @@
 
 void test01()
 {
-#if _GLIBCXX_USE_C99_MATH_TR1
+#if _GLIBCXX_USE_C99_MATH_FUNCS
 
   typedef std::double_t  my_double_t;
   typedef std::float_t   my_float_t;
index 7d9471a1dedfd93f1e79bd80ea71bc983a861ca0..c83147ce99adc1b171d3997d8acc8b840079c1d8 100644 (file)
@@ -1071,7 +1071,7 @@ proc check_v3_target_cstdint { } {
 # Return 1 if the C99 math facilities are available, 0 otherwise.
 proc check_v3_target_cmath { } {
     return [check_v3_target_prop_cached et_c99_math {
-       set cond "defined _GLIBCXX_USE_C99_MATH_TR1"
+       set cond "defined _GLIBCXX_USE_C99_MATH_FUNCS"
        return [v3_check_preprocessor_condition cmath $cond]
     }]
 }
index 763707bbfacb9d7d4995d76d09d486316199fdbb..a0c6bfda3aca4e2d8f0058c837b2e65e54dbb188 100644 (file)
@@ -83,7 +83,7 @@ namespace __gnu_test
       return 0.0;
   }
 
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
   inline double
   binomial_pdf(int k, int n, double p)
   {
@@ -141,7 +141,7 @@ namespace __gnu_test
       return p * std::pow(1 - p, k);
   }
 
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
   inline double
   negative_binomial_pdf(int k, int n, double p)
   {
@@ -179,7 +179,7 @@ namespace __gnu_test
       return 1.0 / (b - a + 1.0);
   }
 
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
   inline double
   lbincoef(int n, int k)
   {