aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog9
-rw-r--r--libstdc++-v3/acinclude.m425
-rw-r--r--libstdc++-v3/config.h.in3
-rwxr-xr-xlibstdc++-v3/configure46
-rw-r--r--libstdc++-v3/include/c_global/cmath4
5 files changed, 87 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 4111bae..5d9f26d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,14 @@
2017-01-09 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/79017
+ * acinclude.m4 (GLIBCXX_CHECK_C99_TR1): Check for llrint and llround
+ functions separately on darwin and if they're missing define
+ _GLIBCXX_NO_C99_ROUNDING_FUNCS.
+ * config.h.in: Regenerate.
+ * configure: Regenerate.
+ * include/c_global/cmath [_GLIBCXX_NO_C99_ROUNDING_FUNCS] (llrint)
+ (llrintf, llrintl, llround, llroundf, llroundl): Do not define.
+
* testsuite/30_threads/condition_variable/members/3.cc: Use new macro
to detect correct thread_local destructors.
* testsuite/util/testsuite_hooks.h (CORRECT_THREAD_LOCAL_DTORS):
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index eef107a..4e04cce 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1890,12 +1890,14 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
lgamma(0.0);
lgammaf(0.0f);
lgammal(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
log1p(0.0);
log1pf(0.0f);
log1pl(0.0l);
@@ -1954,6 +1956,29 @@ 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_MSG_CHECKING([for ISO C99 rounding functions in <math.h>])
+ AC_CACHE_VAL(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])
+ ])
+ AC_MSG_RESULT($glibcxx_cv_c99_math_llround)
+ ;;
+ 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
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index cdd313b..51b770d 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -819,6 +819,9 @@
/* Define to the letter to which size_t is mangled. */
#undef _GLIBCXX_MANGLE_SIZE_T
+/* Define if C99 llrint and llround functions are missing from <math.h>. */
+#undef _GLIBCXX_NO_C99_ROUNDING_FUNCS
+
/* Define if ptrdiff_t is int. */
#undef _GLIBCXX_PTRDIFF_T_IS_INT
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index c7f679a..64d8933 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -20079,12 +20079,14 @@ typedef double_t my_double_t;
lgamma(0.0);
lgammaf(0.0f);
lgammal(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
log1p(0.0);
log1pf(0.0f);
log1pl(0.0l);
@@ -20156,6 +20158,50 @@ $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 test "${glibcxx_cv_c99_math_llround+set}" = set; 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
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index 3630a5b..6e7508f 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -1012,12 +1012,14 @@ _GLIBCXX_END_NAMESPACE_VERSION
#undef lgamma
#undef lgammaf
#undef lgammal
+#ifndef _GLIBCXX_NO_C99_ROUNDING_FUNCS
#undef llrint
#undef llrintf
#undef llrintl
#undef llround
#undef llroundf
#undef llroundl
+#endif
#undef log1p
#undef log1pf
#undef log1pl
@@ -1143,6 +1145,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::lgammaf;
using ::lgammal;
+#ifndef _GLIBCXX_NO_C99_ROUNDING_FUNCS
using ::llrint;
using ::llrintf;
using ::llrintl;
@@ -1150,6 +1153,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::llround;
using ::llroundf;
using ::llroundl;
+#endif
using ::log1p;
using ::log1pf;