Add std::timespec and std::timespec_get for C++17
* configure.ac: Check for C11 timespec_get function. * crossconfig.m4 (freebsd, linux, gnu, cygwin, solaris, netbsd) (openbsd): Likewise * config.h.in: Regenerate. * configure: Regenerate. * include/c_global/ctime (timespec, timespec_get): Add to namespace std for C++17 and up. From-SVN: r268879
This commit is contained in:
parent
1f4dcbf7cd
commit
a61ae535c3
|
@ -1,5 +1,13 @@
|
||||||
2019-02-14 Jonathan Wakely <jwakely@redhat.com>
|
2019-02-14 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
* configure.ac: Check for C11 timespec_get function.
|
||||||
|
* crossconfig.m4 (freebsd, linux, gnu, cygwin, solaris, netbsd)
|
||||||
|
(openbsd): Likewise
|
||||||
|
* config.h.in: Regenerate.
|
||||||
|
* configure: Regenerate.
|
||||||
|
* include/c_global/ctime (timespec, timespec_get): Add to namespace
|
||||||
|
std for C++17 and up.
|
||||||
|
|
||||||
* doc/xml/manual/intro.xml: Document LWG 2537 status.
|
* doc/xml/manual/intro.xml: Document LWG 2537 status.
|
||||||
* include/bits/stl_queue.h
|
* include/bits/stl_queue.h
|
||||||
(priority_queue(const Compare&, const Container&, const Alloc&))
|
(priority_queue(const Compare&, const Container&, const Alloc&))
|
||||||
|
|
|
@ -508,6 +508,9 @@
|
||||||
/* Define to 1 if you have the <tgmath.h> header file. */
|
/* Define to 1 if you have the <tgmath.h> header file. */
|
||||||
#undef HAVE_TGMATH_H
|
#undef HAVE_TGMATH_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `timespec_get' function. */
|
||||||
|
#undef HAVE_TIMESPEC_GET
|
||||||
|
|
||||||
/* Define to 1 if the target supports thread-local storage. */
|
/* Define to 1 if the target supports thread-local storage. */
|
||||||
#undef HAVE_TLS
|
#undef HAVE_TLS
|
||||||
|
|
||||||
|
|
|
@ -28428,6 +28428,19 @@ if test "x$ac_cv_func__wfopen" = xyes; then :
|
||||||
#define HAVE__WFOPEN 1
|
#define HAVE__WFOPEN 1
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
# C11 functions for C++17 library
|
||||||
|
for ac_func in timespec_get
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_func "$LINENO" "timespec_get" "ac_cv_func_timespec_get"
|
||||||
|
if test "x$ac_cv_func_timespec_get" = xyes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_TIMESPEC_GET 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -53613,6 +53626,17 @@ if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
|
||||||
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for ac_func in timespec_get
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_func "$LINENO" "timespec_get" "ac_cv_func_timespec_get"
|
||||||
|
if test "x$ac_cv_func_timespec_get" = xyes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_TIMESPEC_GET 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -60232,6 +60256,17 @@ _ACEOF
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
for ac_func in timespec_get
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_func "$LINENO" "timespec_get" "ac_cv_func_timespec_get"
|
||||||
|
if test "x$ac_cv_func_timespec_get" = xyes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_TIMESPEC_GET 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -66542,6 +66577,17 @@ if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
|
||||||
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for ac_func in timespec_get
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_func "$LINENO" "timespec_get" "ac_cv_func_timespec_get"
|
||||||
|
if test "x$ac_cv_func_timespec_get" = xyes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_TIMESPEC_GET 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -265,6 +265,9 @@ if $GLIBCXX_IS_NATIVE; then
|
||||||
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
||||||
AC_CHECK_FUNCS(_wfopen)
|
AC_CHECK_FUNCS(_wfopen)
|
||||||
|
|
||||||
|
# C11 functions for C++17 library
|
||||||
|
AC_CHECK_FUNCS(timespec_get)
|
||||||
|
|
||||||
# For iconv support.
|
# For iconv support.
|
||||||
AM_ICONV
|
AM_ICONV
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,7 @@ case "${host}" in
|
||||||
fi
|
fi
|
||||||
AC_CHECK_FUNCS(__cxa_thread_atexit)
|
AC_CHECK_FUNCS(__cxa_thread_atexit)
|
||||||
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
||||||
|
AC_CHECK_FUNCS(timespec_get)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*-fuchsia*)
|
*-fuchsia*)
|
||||||
|
@ -194,6 +195,7 @@ case "${host}" in
|
||||||
GCC_CHECK_TLS
|
GCC_CHECK_TLS
|
||||||
AC_CHECK_FUNCS(__cxa_thread_atexit_impl)
|
AC_CHECK_FUNCS(__cxa_thread_atexit_impl)
|
||||||
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
||||||
|
AC_CHECK_FUNCS(timespec_get)
|
||||||
AM_ICONV
|
AM_ICONV
|
||||||
;;
|
;;
|
||||||
*-mingw32*)
|
*-mingw32*)
|
||||||
|
@ -221,6 +223,7 @@ case "${host}" in
|
||||||
AC_DEFINE(HAVE_ISNANL)
|
AC_DEFINE(HAVE_ISNANL)
|
||||||
fi
|
fi
|
||||||
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
||||||
|
AC_CHECK_FUNCS(timespec_get)
|
||||||
;;
|
;;
|
||||||
*-qnx6.1* | *-qnx6.2*)
|
*-qnx6.1* | *-qnx6.2*)
|
||||||
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
||||||
|
|
|
@ -72,4 +72,13 @@ namespace std
|
||||||
using ::strftime;
|
using ::strftime;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
#if __cplusplus >= 201703L && defined(_GLIBCXX_HAVE_TIMESPEC_GET)
|
||||||
|
#undef timespec_get
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
using ::timespec;
|
||||||
|
using ::timespec_get;
|
||||||
|
} // namespace std
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue