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):
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);
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
/* 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
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);
$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
#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
using ::lgammaf;
using ::lgammal;
+#ifndef _GLIBCXX_NO_C99_ROUNDING_FUNCS
using ::llrint;
using ::llrintf;
using ::llrintl;
using ::llround;
using ::llroundf;
using ::llroundl;
+#endif
using ::log1p;
using ::log1pf;