2003-08-05 10:00:18 +08:00
|
|
|
dnl
|
2006-09-21 20:07:36 +08:00
|
|
|
dnl This file contains details for non-native builds.
|
2003-08-05 10:00:18 +08:00
|
|
|
dnl
|
|
|
|
|
2005-04-06 08:05:51 +08:00
|
|
|
AC_DEFUN([GLIBCXX_CROSSCONFIG],[
|
2003-08-05 10:00:18 +08:00
|
|
|
# Base decisions on target environment.
|
|
|
|
case "${host}" in
|
2004-08-03 04:28:22 +08:00
|
|
|
arm*-*-symbianelf*)
|
|
|
|
# This is a freestanding configuration; there is nothing to do here.
|
|
|
|
;;
|
|
|
|
|
2016-12-07 01:58:05 +08:00
|
|
|
avr*-*-*)
|
|
|
|
AC_DEFINE(HAVE_ACOSF)
|
|
|
|
AC_DEFINE(HAVE_ASINF)
|
|
|
|
AC_DEFINE(HAVE_ATAN2F)
|
|
|
|
AC_DEFINE(HAVE_ATANF)
|
|
|
|
AC_DEFINE(HAVE_CEILF)
|
|
|
|
AC_DEFINE(HAVE_COSF)
|
|
|
|
AC_DEFINE(HAVE_COSHF)
|
|
|
|
AC_DEFINE(HAVE_EXPF)
|
|
|
|
AC_DEFINE(HAVE_FABSF)
|
|
|
|
AC_DEFINE(HAVE_FLOORF)
|
|
|
|
AC_DEFINE(HAVE_FMODF)
|
|
|
|
AC_DEFINE(HAVE_FREXPF)
|
|
|
|
AC_DEFINE(HAVE_SQRTF)
|
|
|
|
AC_DEFINE(HAVE_HYPOTF)
|
|
|
|
AC_DEFINE(HAVE_LDEXPF)
|
|
|
|
AC_DEFINE(HAVE_LOG10F)
|
|
|
|
AC_DEFINE(HAVE_LOGF)
|
|
|
|
AC_DEFINE(HAVE_MODFF)
|
|
|
|
AC_DEFINE(HAVE_POWF)
|
|
|
|
AC_DEFINE(HAVE_SINF)
|
|
|
|
AC_DEFINE(HAVE_SINHF)
|
|
|
|
AC_DEFINE(HAVE_TANF)
|
|
|
|
AC_DEFINE(HAVE_TANHF)
|
|
|
|
;;
|
|
|
|
|
2007-09-14 22:50:26 +08:00
|
|
|
mips*-sde-elf*)
|
|
|
|
# These definitions are for the SDE C library rather than newlib.
|
|
|
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
|
|
|
AC_SUBST(SECTION_FLAGS)
|
|
|
|
GLIBCXX_CHECK_COMPILER_FEATURES
|
|
|
|
GLIBCXX_CHECK_LINKER_FEATURES
|
|
|
|
GLIBCXX_CHECK_MATH_SUPPORT
|
|
|
|
GLIBCXX_CHECK_STDLIB_SUPPORT
|
|
|
|
|
|
|
|
AC_DEFINE(HAVE_FINITE)
|
|
|
|
AC_DEFINE(HAVE_HYPOT)
|
|
|
|
AC_DEFINE(HAVE_ISNAN)
|
|
|
|
AC_DEFINE(HAVE_ISINF)
|
|
|
|
|
|
|
|
AC_DEFINE(HAVE_LDEXPF)
|
|
|
|
AC_DEFINE(HAVE_MODF)
|
|
|
|
AC_DEFINE(HAVE_SQRTF)
|
|
|
|
;;
|
|
|
|
|
2009-06-03 03:15:03 +08:00
|
|
|
*-aix*)
|
|
|
|
GLIBCXX_CHECK_LINKER_FEATURES
|
|
|
|
GLIBCXX_CHECK_MATH_SUPPORT
|
|
|
|
GLIBCXX_CHECK_STDLIB_SUPPORT
|
2018-10-16 22:49:29 +08:00
|
|
|
AC_DEFINE(_GLIBCXX_USE_DEV_RANDOM)
|
2009-06-03 03:15:03 +08:00
|
|
|
AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1)
|
|
|
|
# We don't yet support AIX's TLS ABI.
|
|
|
|
#GCC_CHECK_TLS
|
|
|
|
AM_ICONV
|
libstdc++: Add std::from_chars for floating-point types
This adds the missing std::from_chars overloads for floating-point
types, as required for C++17 conformance.
The implementation is a hack and not intended to be used in the long
term. Rather than parsing the string directly, this determines the
initial portion of the string that matches the pattern determined by the
chars_format parameter, then creates a NTBS to be parsed by strtod (or
strtold or strtof).
Because creating a NTBS requires allocating memory, but std::from_chars
is noexcept, we need to be careful to minimise allocation. Even after
being careful, allocation failure is still possible, and so a
non-conforming std::no_more_memory error code might be returned.
Because strtod et al depend on the current locale, but std::from_chars
does not, we change the current thread's locale to "C" using newlocale
and uselocale before calling strtod, and restore it afterwards.
Because strtod doesn't have the equivalent of a std::chars_format
parameter, it has to examine the input to determine the format in use,
even though the std::from_chars code has already parsed it once (or
twice for large input strings!)
By replacing the use of strtod we could avoid allocation, avoid changing
locale, and use optimised code paths specific to each std::chars_format
case. We would also get more portable behaviour, rather than depending
on the presence of uselocale, and on any bugs or quirks of the target
libc's strtod. Replacing strtod is a project for a later date.
libstdc++-v3/ChangeLog:
* acinclude.m4 (libtool_VERSION): Bump version.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver: Add GLIBCXX_3.4.29 version and new
exports.
* config/os/gnu-linux/ldbl-extra.ver: Add _GLIBCXX_LDBL_3.4.29
version and new export.
* configure: Regenerate.
* configure.ac: Check for <xlocale.h> and uselocale.
* crossconfig.m4: Add macro or checks for uselocale.
* include/std/charconv (from_chars): Declare overloads for
float, double, and long double.
* src/c++17/Makefile.am: Add new file.
* src/c++17/Makefile.in: Regenerate.
* src/c++17/floating_from_chars.cc: New file.
(from_chars): Define for float, double, and long double.
* testsuite/20_util/from_chars/1_c++20_neg.cc: Prune extra
diagnostics caused by new overloads.
* testsuite/20_util/from_chars/1_neg.cc: Likewise.
* testsuite/20_util/from_chars/2.cc: Check leading '+'.
* testsuite/20_util/from_chars/4.cc: New test.
* testsuite/20_util/from_chars/5.cc: New test.
* testsuite/util/testsuite_abi.cc: Add new symbol versions.
2020-07-21 06:49:27 +08:00
|
|
|
|
|
|
|
AC_DEFINE(HAVE_USELOCALE)
|
2009-06-03 03:15:03 +08:00
|
|
|
;;
|
|
|
|
|
2003-08-20 11:32:00 +08:00
|
|
|
*-darwin*)
|
|
|
|
# Darwin versions vary, but the linker should work in a cross environment,
|
|
|
|
# so we just check for all the features here.
|
|
|
|
# Check for available headers.
|
|
|
|
|
|
|
|
# Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
|
|
|
|
GLIBCXX_CHECK_MATH_SUPPORT
|
|
|
|
GLIBCXX_CHECK_STDLIB_SUPPORT
|
libstdc++: Add std::from_chars for floating-point types
This adds the missing std::from_chars overloads for floating-point
types, as required for C++17 conformance.
The implementation is a hack and not intended to be used in the long
term. Rather than parsing the string directly, this determines the
initial portion of the string that matches the pattern determined by the
chars_format parameter, then creates a NTBS to be parsed by strtod (or
strtold or strtof).
Because creating a NTBS requires allocating memory, but std::from_chars
is noexcept, we need to be careful to minimise allocation. Even after
being careful, allocation failure is still possible, and so a
non-conforming std::no_more_memory error code might be returned.
Because strtod et al depend on the current locale, but std::from_chars
does not, we change the current thread's locale to "C" using newlocale
and uselocale before calling strtod, and restore it afterwards.
Because strtod doesn't have the equivalent of a std::chars_format
parameter, it has to examine the input to determine the format in use,
even though the std::from_chars code has already parsed it once (or
twice for large input strings!)
By replacing the use of strtod we could avoid allocation, avoid changing
locale, and use optimised code paths specific to each std::chars_format
case. We would also get more portable behaviour, rather than depending
on the presence of uselocale, and on any bugs or quirks of the target
libc's strtod. Replacing strtod is a project for a later date.
libstdc++-v3/ChangeLog:
* acinclude.m4 (libtool_VERSION): Bump version.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver: Add GLIBCXX_3.4.29 version and new
exports.
* config/os/gnu-linux/ldbl-extra.ver: Add _GLIBCXX_LDBL_3.4.29
version and new export.
* configure: Regenerate.
* configure.ac: Check for <xlocale.h> and uselocale.
* crossconfig.m4: Add macro or checks for uselocale.
* include/std/charconv (from_chars): Declare overloads for
float, double, and long double.
* src/c++17/Makefile.am: Add new file.
* src/c++17/Makefile.in: Regenerate.
* src/c++17/floating_from_chars.cc: New file.
(from_chars): Define for float, double, and long double.
* testsuite/20_util/from_chars/1_c++20_neg.cc: Prune extra
diagnostics caused by new overloads.
* testsuite/20_util/from_chars/1_neg.cc: Likewise.
* testsuite/20_util/from_chars/2.cc: Check leading '+'.
* testsuite/20_util/from_chars/4.cc: New test.
* testsuite/20_util/from_chars/5.cc: New test.
* testsuite/util/testsuite_abi.cc: Add new symbol versions.
2020-07-21 06:49:27 +08:00
|
|
|
|
|
|
|
AC_CHECK_FUNCS(uselocale)
|
2003-08-20 11:32:00 +08:00
|
|
|
;;
|
|
|
|
|
2004-07-07 09:07:05 +08:00
|
|
|
*djgpp)
|
2007-03-03 18:52:24 +08:00
|
|
|
# GLIBCXX_CHECK_MATH_SUPPORT
|
2007-02-27 05:37:05 +08:00
|
|
|
AC_DEFINE(HAVE_ISINF)
|
|
|
|
AC_DEFINE(HAVE_ISNAN)
|
|
|
|
AC_DEFINE(HAVE_FINITE)
|
|
|
|
AC_DEFINE(HAVE_SINCOS)
|
|
|
|
AC_DEFINE(HAVE_HYPOT)
|
2004-07-07 09:07:05 +08:00
|
|
|
;;
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
*-freebsd*)
|
|
|
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
|
|
|
AC_SUBST(SECTION_FLAGS)
|
|
|
|
GLIBCXX_CHECK_LINKER_FEATURES
|
|
|
|
AC_DEFINE(HAVE_SETENV)
|
|
|
|
AC_DEFINE(HAVE_FINITEF)
|
|
|
|
AC_DEFINE(HAVE_FINITE)
|
|
|
|
AC_DEFINE(HAVE_FREXPF)
|
|
|
|
AC_DEFINE(HAVE_HYPOT)
|
|
|
|
AC_DEFINE(HAVE_HYPOTF)
|
|
|
|
AC_DEFINE(HAVE_ISINF)
|
|
|
|
AC_DEFINE(HAVE_ISNAN)
|
|
|
|
AC_DEFINE(HAVE_ISNANF)
|
|
|
|
|
|
|
|
AC_DEFINE(HAVE_ACOSF)
|
|
|
|
AC_DEFINE(HAVE_ASINF)
|
|
|
|
AC_DEFINE(HAVE_ATAN2F)
|
|
|
|
AC_DEFINE(HAVE_ATANF)
|
|
|
|
AC_DEFINE(HAVE_CEILF)
|
|
|
|
AC_DEFINE(HAVE_COSF)
|
|
|
|
AC_DEFINE(HAVE_COSHF)
|
|
|
|
AC_DEFINE(HAVE_EXPF)
|
|
|
|
AC_DEFINE(HAVE_FABSF)
|
|
|
|
AC_DEFINE(HAVE_FLOORF)
|
|
|
|
AC_DEFINE(HAVE_FMODF)
|
|
|
|
AC_DEFINE(HAVE_FREXPF)
|
|
|
|
AC_DEFINE(HAVE_LDEXPF)
|
|
|
|
AC_DEFINE(HAVE_LOG10F)
|
|
|
|
AC_DEFINE(HAVE_LOGF)
|
|
|
|
AC_DEFINE(HAVE_MODFF)
|
|
|
|
AC_DEFINE(HAVE_POWF)
|
|
|
|
AC_DEFINE(HAVE_SINF)
|
|
|
|
AC_DEFINE(HAVE_SINHF)
|
|
|
|
AC_DEFINE(HAVE_SQRTF)
|
|
|
|
AC_DEFINE(HAVE_TANF)
|
|
|
|
AC_DEFINE(HAVE_TANHF)
|
|
|
|
if test x"long_double_math_on_this_cpu" = x"yes"; then
|
|
|
|
AC_DEFINE(HAVE_FINITEL)
|
|
|
|
AC_DEFINE(HAVE_ISINFL)
|
|
|
|
AC_DEFINE(HAVE_ISNANL)
|
|
|
|
fi
|
2017-01-07 01:06:24 +08:00
|
|
|
AC_CHECK_FUNCS(__cxa_thread_atexit)
|
2018-03-13 06:52:16 +08:00
|
|
|
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
2019-02-14 22:10:25 +08:00
|
|
|
AC_CHECK_FUNCS(timespec_get)
|
2019-03-12 00:28:11 +08:00
|
|
|
AC_CHECK_FUNCS(sockatmark)
|
libstdc++: Add std::from_chars for floating-point types
This adds the missing std::from_chars overloads for floating-point
types, as required for C++17 conformance.
The implementation is a hack and not intended to be used in the long
term. Rather than parsing the string directly, this determines the
initial portion of the string that matches the pattern determined by the
chars_format parameter, then creates a NTBS to be parsed by strtod (or
strtold or strtof).
Because creating a NTBS requires allocating memory, but std::from_chars
is noexcept, we need to be careful to minimise allocation. Even after
being careful, allocation failure is still possible, and so a
non-conforming std::no_more_memory error code might be returned.
Because strtod et al depend on the current locale, but std::from_chars
does not, we change the current thread's locale to "C" using newlocale
and uselocale before calling strtod, and restore it afterwards.
Because strtod doesn't have the equivalent of a std::chars_format
parameter, it has to examine the input to determine the format in use,
even though the std::from_chars code has already parsed it once (or
twice for large input strings!)
By replacing the use of strtod we could avoid allocation, avoid changing
locale, and use optimised code paths specific to each std::chars_format
case. We would also get more portable behaviour, rather than depending
on the presence of uselocale, and on any bugs or quirks of the target
libc's strtod. Replacing strtod is a project for a later date.
libstdc++-v3/ChangeLog:
* acinclude.m4 (libtool_VERSION): Bump version.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver: Add GLIBCXX_3.4.29 version and new
exports.
* config/os/gnu-linux/ldbl-extra.ver: Add _GLIBCXX_LDBL_3.4.29
version and new export.
* configure: Regenerate.
* configure.ac: Check for <xlocale.h> and uselocale.
* crossconfig.m4: Add macro or checks for uselocale.
* include/std/charconv (from_chars): Declare overloads for
float, double, and long double.
* src/c++17/Makefile.am: Add new file.
* src/c++17/Makefile.in: Regenerate.
* src/c++17/floating_from_chars.cc: New file.
(from_chars): Define for float, double, and long double.
* testsuite/20_util/from_chars/1_c++20_neg.cc: Prune extra
diagnostics caused by new overloads.
* testsuite/20_util/from_chars/1_neg.cc: Likewise.
* testsuite/20_util/from_chars/2.cc: Check leading '+'.
* testsuite/20_util/from_chars/4.cc: New test.
* testsuite/20_util/from_chars/5.cc: New test.
* testsuite/util/testsuite_abi.cc: Add new symbol versions.
2020-07-21 06:49:27 +08:00
|
|
|
AC_CHECK_FUNCS(uselocale)
|
2003-08-05 10:00:18 +08:00
|
|
|
;;
|
2017-01-18 07:36:12 +08:00
|
|
|
|
|
|
|
*-fuchsia*)
|
|
|
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
|
|
|
AC_SUBST(SECTION_FLAGS)
|
|
|
|
;;
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
*-hpux*)
|
|
|
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
|
|
|
AC_SUBST(SECTION_FLAGS)
|
|
|
|
GLIBCXX_CHECK_LINKER_FEATURES
|
2009-01-13 09:49:30 +08:00
|
|
|
|
|
|
|
# GLIBCXX_CHECK_MATH_SUPPORT
|
|
|
|
AC_DEFINE(HAVE_ISNAN)
|
|
|
|
AC_DEFINE(HAVE_HYPOT)
|
|
|
|
AC_DEFINE(HAVE_ACOSF)
|
|
|
|
AC_DEFINE(HAVE_ASINF)
|
|
|
|
AC_DEFINE(HAVE_ATANF)
|
|
|
|
AC_DEFINE(HAVE_COSF)
|
|
|
|
AC_DEFINE(HAVE_COSHF)
|
|
|
|
AC_DEFINE(HAVE_SINF)
|
|
|
|
AC_DEFINE(HAVE_SINHF)
|
|
|
|
AC_DEFINE(HAVE_TANF)
|
|
|
|
AC_DEFINE(HAVE_TANHF)
|
|
|
|
AC_DEFINE(HAVE_EXPF)
|
|
|
|
AC_DEFINE(HAVE_ATAN2F)
|
2009-01-06 04:50:25 +08:00
|
|
|
AC_DEFINE(HAVE_FABSF)
|
2009-01-13 09:49:30 +08:00
|
|
|
AC_DEFINE(HAVE_FMODF)
|
2003-08-05 10:00:18 +08:00
|
|
|
AC_DEFINE(HAVE_FREXPF)
|
2009-01-13 09:49:30 +08:00
|
|
|
AC_DEFINE(HAVE_LOGF)
|
|
|
|
AC_DEFINE(HAVE_LOG10F)
|
|
|
|
AC_DEFINE(HAVE_MODF)
|
|
|
|
AC_DEFINE(HAVE_POWF)
|
|
|
|
AC_DEFINE(HAVE_SQRTF)
|
|
|
|
|
|
|
|
# GLIBCXX_CHECK_STDLIB_SUPPORT
|
|
|
|
AC_DEFINE(HAVE_STRTOLD)
|
|
|
|
|
|
|
|
GCC_CHECK_TLS
|
2003-08-05 10:00:18 +08:00
|
|
|
case "$target" in
|
|
|
|
*-hpux10*)
|
|
|
|
AC_DEFINE(HAVE_ISINF)
|
|
|
|
AC_DEFINE(HAVE_ISINFF)
|
|
|
|
AC_DEFINE(HAVE_ISNANF)
|
2009-01-13 09:49:30 +08:00
|
|
|
AC_DEFINE(HAVE_FINITE)
|
|
|
|
AC_DEFINE(HAVE_FINITEF)
|
2003-08-05 10:00:18 +08:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
2017-06-01 21:50:03 +08:00
|
|
|
*-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-cygwin* | *-solaris*)
|
2006-02-17 07:29:10 +08:00
|
|
|
GLIBCXX_CHECK_COMPILER_FEATURES
|
2003-08-05 10:00:18 +08:00
|
|
|
GLIBCXX_CHECK_LINKER_FEATURES
|
2006-02-17 07:29:10 +08:00
|
|
|
GLIBCXX_CHECK_MATH_SUPPORT
|
|
|
|
GLIBCXX_CHECK_STDLIB_SUPPORT
|
2018-10-16 22:49:29 +08:00
|
|
|
AC_DEFINE(_GLIBCXX_USE_DEV_RANDOM)
|
2008-06-07 03:11:26 +08:00
|
|
|
AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1)
|
2009-01-13 09:49:30 +08:00
|
|
|
GCC_CHECK_TLS
|
2015-10-12 06:34:28 +08:00
|
|
|
AC_CHECK_FUNCS(__cxa_thread_atexit_impl)
|
2016-12-01 14:06:04 +08:00
|
|
|
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
2019-02-14 22:10:25 +08:00
|
|
|
AC_CHECK_FUNCS(timespec_get)
|
2019-03-12 00:28:11 +08:00
|
|
|
AC_CHECK_FUNCS(sockatmark)
|
libstdc++: Add std::from_chars for floating-point types
This adds the missing std::from_chars overloads for floating-point
types, as required for C++17 conformance.
The implementation is a hack and not intended to be used in the long
term. Rather than parsing the string directly, this determines the
initial portion of the string that matches the pattern determined by the
chars_format parameter, then creates a NTBS to be parsed by strtod (or
strtold or strtof).
Because creating a NTBS requires allocating memory, but std::from_chars
is noexcept, we need to be careful to minimise allocation. Even after
being careful, allocation failure is still possible, and so a
non-conforming std::no_more_memory error code might be returned.
Because strtod et al depend on the current locale, but std::from_chars
does not, we change the current thread's locale to "C" using newlocale
and uselocale before calling strtod, and restore it afterwards.
Because strtod doesn't have the equivalent of a std::chars_format
parameter, it has to examine the input to determine the format in use,
even though the std::from_chars code has already parsed it once (or
twice for large input strings!)
By replacing the use of strtod we could avoid allocation, avoid changing
locale, and use optimised code paths specific to each std::chars_format
case. We would also get more portable behaviour, rather than depending
on the presence of uselocale, and on any bugs or quirks of the target
libc's strtod. Replacing strtod is a project for a later date.
libstdc++-v3/ChangeLog:
* acinclude.m4 (libtool_VERSION): Bump version.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver: Add GLIBCXX_3.4.29 version and new
exports.
* config/os/gnu-linux/ldbl-extra.ver: Add _GLIBCXX_LDBL_3.4.29
version and new export.
* configure: Regenerate.
* configure.ac: Check for <xlocale.h> and uselocale.
* crossconfig.m4: Add macro or checks for uselocale.
* include/std/charconv (from_chars): Declare overloads for
float, double, and long double.
* src/c++17/Makefile.am: Add new file.
* src/c++17/Makefile.in: Regenerate.
* src/c++17/floating_from_chars.cc: New file.
(from_chars): Define for float, double, and long double.
* testsuite/20_util/from_chars/1_c++20_neg.cc: Prune extra
diagnostics caused by new overloads.
* testsuite/20_util/from_chars/1_neg.cc: Likewise.
* testsuite/20_util/from_chars/2.cc: Check leading '+'.
* testsuite/20_util/from_chars/4.cc: New test.
* testsuite/20_util/from_chars/5.cc: New test.
* testsuite/util/testsuite_abi.cc: Add new symbol versions.
2020-07-21 06:49:27 +08:00
|
|
|
AC_CHECK_FUNCS(uselocale)
|
2008-06-07 03:11:26 +08:00
|
|
|
AM_ICONV
|
2003-08-05 10:00:18 +08:00
|
|
|
;;
|
|
|
|
*-mingw32*)
|
|
|
|
GLIBCXX_CHECK_LINKER_FEATURES
|
2009-01-21 03:30:51 +08:00
|
|
|
GLIBCXX_CHECK_MATH_SUPPORT
|
|
|
|
GLIBCXX_CHECK_STDLIB_SUPPORT
|
2018-03-13 06:52:16 +08:00
|
|
|
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
Add support for opening file streams from wide character strings
C++17 added new overloads to <fstream> class templates to support
opening files from wide character strings "on systems where
filesystem::path::value_type is not char". This patch adds those
overloads conditional on _wfopen being available, and enables them for
pre-C++17 modes as well.
Add support for opening file streams from wide character strings.
* config/io/basic_file_stdio.cc [_GLIBCXX_HAVE__WFOPEN]
(__basic_file<char>::open(const wchar_t*, ios_base::openmode)):
Define new overload.
* config/io/basic_file_stdio.h [_GLIBCXX_HAVE__WFOPEN]
(__basic_file<char>::open(const wchar_t*, ios_base::openmode)):
Declare new overload.
* configure.ac: Check for _wfopen.
* crossconfig.m4: Likewise.
* configure: Regenerate.
* config.h.in: Regenerate.
* include/bits/fstream.tcc [_GLIBCXX_HAVE__WFOPEN]
(basic_filebuf<C,T>::open(const wchar_t*, ios_base::openmode)):
Define new overload.
* include/std/fstream [_GLIBCXX_HAVE__WFOPEN]
(basic_filebuf<C,T>::open(const wchar_t*, ios_base::openmode)):
Declare new overload.
[_GLIBCXX_HAVE__WFOPEN]
(basic_ifstream<C,T>::basic_ifstream(const wchar_t*, openmode))
(basic_ifstream<C,T>::basic_open(const wchar_t*, openmode))
(basic_ofstream<C,T>::basic_ifstream(const wchar_t*, openmode))
(basic_ofstream<C,T>::basic_open(const wchar_t*, openmode))
(basic_fstream<C,T>::basic_ifstream(const wchar_t*, openmode))
(basic_fstream<C,T>::basic_open(const wchar_t*, openmode)): Define
new overloads.
* testsuite/27_io/basic_filebuf/open/wchar_t/1.cc: New.
* testsuite/27_io/basic_ifstream/cons/wchar_t/1.cc: New.
* testsuite/27_io/basic_ifstream/open/wchar_t/1.cc: New.
* testsuite/27_io/basic_ofstream/cons/wchar_t/1.cc: New.
* testsuite/27_io/basic_ofstream/open/wchar_t/1.cc: New.
* testsuite/27_io/basic_fstream/cons/wchar_t/1.cc: New.
* testsuite/27_io/basic_fstream/open/wchar_t/1.cc: New.
From-SVN: r260479
2018-05-22 01:18:35 +08:00
|
|
|
AC_CHECK_FUNCS(_wfopen)
|
2021-09-14 23:41:37 +08:00
|
|
|
GCC_CHECK_TLS
|
2003-08-05 10:00:18 +08:00
|
|
|
;;
|
2018-06-19 01:28:53 +08:00
|
|
|
*-netbsd* | *-openbsd*)
|
2003-08-05 10:00:18 +08:00
|
|
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
|
|
|
AC_SUBST(SECTION_FLAGS)
|
|
|
|
GLIBCXX_CHECK_LINKER_FEATURES
|
|
|
|
AC_DEFINE(HAVE_FINITEF)
|
|
|
|
AC_DEFINE(HAVE_FINITE)
|
|
|
|
AC_DEFINE(HAVE_FREXPF)
|
|
|
|
AC_DEFINE(HAVE_HYPOTF)
|
|
|
|
AC_DEFINE(HAVE_ISINF)
|
|
|
|
AC_DEFINE(HAVE_ISINFF)
|
|
|
|
AC_DEFINE(HAVE_ISNAN)
|
|
|
|
AC_DEFINE(HAVE_ISNANF)
|
|
|
|
if test x"long_double_math_on_this_cpu" = x"yes"; then
|
|
|
|
AC_DEFINE(HAVE_FINITEL)
|
|
|
|
AC_DEFINE(HAVE_ISINFL)
|
|
|
|
AC_DEFINE(HAVE_ISNANL)
|
|
|
|
fi
|
2018-05-25 01:31:13 +08:00
|
|
|
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
|
2019-02-14 22:10:25 +08:00
|
|
|
AC_CHECK_FUNCS(timespec_get)
|
2019-03-12 00:28:11 +08:00
|
|
|
AC_CHECK_FUNCS(sockatmark)
|
2003-08-05 10:00:18 +08:00
|
|
|
;;
|
|
|
|
*-qnx6.1* | *-qnx6.2*)
|
|
|
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
|
|
|
AC_SUBST(SECTION_FLAGS)
|
|
|
|
GLIBCXX_CHECK_LINKER_FEATURES
|
|
|
|
AC_DEFINE(HAVE_COSF)
|
|
|
|
AC_DEFINE(HAVE_COSL)
|
|
|
|
AC_DEFINE(HAVE_COSHF)
|
|
|
|
AC_DEFINE(HAVE_COSHL)
|
|
|
|
AC_DEFINE(HAVE_LOGF)
|
|
|
|
AC_DEFINE(HAVE_LOGL)
|
|
|
|
AC_DEFINE(HAVE_LOG10F)
|
|
|
|
AC_DEFINE(HAVE_LOG10L)
|
|
|
|
AC_DEFINE(HAVE_SINF)
|
|
|
|
AC_DEFINE(HAVE_SINL)
|
|
|
|
AC_DEFINE(HAVE_SINHF)
|
|
|
|
AC_DEFINE(HAVE_SINHL)
|
|
|
|
;;
|
2011-02-04 15:26:57 +08:00
|
|
|
*-rtems*)
|
|
|
|
GLIBCXX_CHECK_COMPILER_FEATURES
|
|
|
|
GLIBCXX_CHECK_LINKER_FEATURES
|
|
|
|
GLIBCXX_CHECK_MATH_SUPPORT
|
|
|
|
GLIBCXX_CHECK_STDLIB_SUPPORT
|
|
|
|
;;
|
2004-01-27 23:36:22 +08:00
|
|
|
*-tpf)
|
|
|
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
2012-05-03 03:34:31 +08:00
|
|
|
SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS'
|
2004-01-27 23:36:22 +08:00
|
|
|
AC_SUBST(SECTION_FLAGS)
|
|
|
|
AC_DEFINE(HAVE_FINITE)
|
|
|
|
AC_DEFINE(HAVE_FINITEF)
|
|
|
|
AC_DEFINE(HAVE_FREXPF)
|
|
|
|
AC_DEFINE(HAVE_HYPOTF)
|
|
|
|
AC_DEFINE(HAVE_ISINF)
|
|
|
|
AC_DEFINE(HAVE_ISINFF)
|
|
|
|
AC_DEFINE(HAVE_ISNAN)
|
|
|
|
AC_DEFINE(HAVE_ISNANF)
|
|
|
|
AC_DEFINE(HAVE_SINCOS)
|
|
|
|
AC_DEFINE(HAVE_SINCOSF)
|
|
|
|
if test x"long_double_math_on_this_cpu" = x"yes"; then
|
|
|
|
AC_DEFINE(HAVE_FINITEL)
|
|
|
|
AC_DEFINE(HAVE_HYPOTL)
|
|
|
|
AC_DEFINE(HAVE_ISINFL)
|
|
|
|
AC_DEFINE(HAVE_ISNANL)
|
|
|
|
fi
|
|
|
|
;;
|
2012-04-02 15:59:27 +08:00
|
|
|
*-*vms*)
|
|
|
|
# Check for available headers.
|
|
|
|
# Don't call GLIBCXX_CHECK_LINKER_FEATURES, VMS doesn't have a GNU ld
|
|
|
|
GLIBCXX_CHECK_MATH_SUPPORT
|
|
|
|
GLIBCXX_CHECK_STDLIB_SUPPORT
|
|
|
|
;;
|
2020-10-20 18:32:27 +08:00
|
|
|
*-vxworks*)
|
2003-10-21 02:27:17 +08:00
|
|
|
AC_DEFINE(HAVE_ACOSF)
|
|
|
|
AC_DEFINE(HAVE_ASINF)
|
|
|
|
AC_DEFINE(HAVE_ATAN2F)
|
|
|
|
AC_DEFINE(HAVE_ATANF)
|
|
|
|
AC_DEFINE(HAVE_CEILF)
|
|
|
|
AC_DEFINE(HAVE_COSF)
|
|
|
|
AC_DEFINE(HAVE_COSHF)
|
|
|
|
AC_DEFINE(HAVE_EXPF)
|
|
|
|
AC_DEFINE(HAVE_FABSF)
|
|
|
|
AC_DEFINE(HAVE_FLOORF)
|
|
|
|
AC_DEFINE(HAVE_FMODF)
|
|
|
|
AC_DEFINE(HAVE_HYPOT)
|
|
|
|
AC_DEFINE(HAVE_LOG10F)
|
|
|
|
AC_DEFINE(HAVE_LOGF)
|
|
|
|
AC_DEFINE(HAVE_POWF)
|
|
|
|
AC_DEFINE(HAVE_SINF)
|
|
|
|
AC_DEFINE(HAVE_SINHF)
|
|
|
|
AC_DEFINE(HAVE_SQRTF)
|
|
|
|
AC_DEFINE(HAVE_TANF)
|
|
|
|
AC_DEFINE(HAVE_TANHF)
|
2019-12-25 14:43:22 +08:00
|
|
|
|
|
|
|
dnl # Different versions and execution modes implement different
|
|
|
|
dnl # subsets of these functions. Instead of hard-coding, test for C
|
|
|
|
dnl # declarations in headers. The C primitives could be defined as
|
|
|
|
dnl # macros, in which case the tests might fail, and we might have to
|
|
|
|
dnl # switch to more elaborate tests.
|
|
|
|
GLIBCXX_CHECK_MATH_DECLS([
|
|
|
|
acosl asinl atan2l atanl ceill cosl coshl expl fabsl floorl fmodl
|
2020-06-01 04:25:28 +08:00
|
|
|
frexpl ldexpl log10l logl modfl powl sinl sinhl sqrtl tanl tanhl hypotl
|
|
|
|
ldexpf modff hypotf frexpf])
|
2019-12-25 14:43:22 +08:00
|
|
|
dnl # sincosl is the only one missing here, compared with the *l
|
|
|
|
dnl # functions in the list guarded by
|
|
|
|
dnl # long_double_math_on_this_cpu in configure.ac, right after
|
|
|
|
dnl # the expansion of the present macro.
|
2003-10-21 02:27:17 +08:00
|
|
|
;;
|
2003-08-05 10:00:18 +08:00
|
|
|
*)
|
|
|
|
AC_MSG_ERROR([No support for this host/target combination.])
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-06 08:05:51 +08:00
|
|
|
])
|
2019-12-25 14:43:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Check to see if the (math function) argument passed is
|
|
|
|
dnl declared when using the c compiler
|
|
|
|
dnl
|
|
|
|
dnl Define HAVE_CARGF etc if "cargf" is declared
|
|
|
|
dnl
|
|
|
|
dnl argument 1 is name of function to check
|
|
|
|
dnl
|
|
|
|
dnl ASSUMES argument is a math function
|
|
|
|
dnl
|
|
|
|
dnl GLIBCXX_CHECK_MATH_DECL
|
|
|
|
AC_DEFUN([GLIBCXX_CHECK_MATH_DECL], [
|
|
|
|
AC_CACHE_CHECK([for $1 declaration],
|
|
|
|
[glibcxx_cv_func_$1_use], [
|
|
|
|
AC_LANG_SAVE
|
|
|
|
AC_LANG_C
|
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#include <math.h>
|
|
|
|
#ifdef HAVE_IEEEFP_H
|
|
|
|
# include <ieeefp.h>
|
|
|
|
#endif
|
2020-01-23 22:36:12 +08:00
|
|
|
#undef $1
|
2019-12-25 14:43:22 +08:00
|
|
|
], [
|
|
|
|
void (*f)(void) = (void (*)(void))$1;
|
|
|
|
], [glibcxx_cv_func_$1_use=yes
|
|
|
|
], [glibcxx_cv_func_$1_use=no])])
|
|
|
|
if test "x$glibcxx_cv_func_$1_use" = xyes; then
|
|
|
|
AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]))
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Check to see whether multiple math functions are
|
|
|
|
dnl declared when using the c compiler
|
|
|
|
dnl
|
|
|
|
dnl Define HAVE_CARGF HAVE_POWL etc if "cargf" and "powl"
|
|
|
|
dnl are declared
|
|
|
|
dnl
|
|
|
|
dnl argument 1 is a word list naming function to check
|
|
|
|
dnl
|
|
|
|
dnl ASSUMES arguments are math functions
|
|
|
|
dnl
|
|
|
|
dnl GLIBCXX_CHECK_MATH_DECLS
|
|
|
|
AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS], [
|
|
|
|
m4_foreach_w([glibcxx_func], [$1], [
|
|
|
|
GLIBCXX_CHECK_MATH_DECL(glibcxx_func)
|
|
|
|
])
|
|
|
|
])
|