2003-08-06 07:32:23 +08:00
|
|
|
/* config.h.in. Generated from configure.ac by autoheader. */
|
2000-06-07 04:26:13 +08:00
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `acosf' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_ACOSF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `acosl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_ACOSL
|
|
|
|
|
2016-09-10 05:22:15 +08:00
|
|
|
/* Define to 1 if you have the `aligned_alloc' function. */
|
|
|
|
#undef HAVE_ALIGNED_ALLOC
|
|
|
|
|
2021-11-04 23:51:37 +08:00
|
|
|
/* Define if arc4random is available in <stdlib.h>. */
|
|
|
|
#undef HAVE_ARC4RANDOM
|
|
|
|
|
Use autoconf to check for features needed by Networking TS
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check for headers used by Networking TS.
* include/experimental/executor: Include <condition_variable>
instead of <mutex>.
* include/experimental/internet: Use autoconf macros for available
headers. Include <sys/socket.h> for. Remove <cstring> and use
__builtin_memcpy and __builtin_strchr.
(resolver_errc) [!_GLIBCXX_HAVE_NETDB_H]: Do not define.
(address_v4::to_string, address_v6::to_string)
[!_GLIBCXX_HAVE_ARPA_INET_H]: Likewise.
(basic_resolver_results) [!_GLIBCXX_HAVE_NETDB_H]: Make private
constructors report errors.
[!_GLIBCXX_HAVE_NETINET_TCP_H] (tcp::no_delay): Do not define.
* include/experimental/io_context: Likewise.
* include/experimental/socket: Likewise.
[!_GLIBCXX_HAVE_SYS_SOCKET_H, !_GLIBCXX_HAVE_POLL_H] (socket_base): Do
not define nested types when relevant header not available.
(__socket_impl::native_non_blocking) [!_GLIBCXX_HAVE_FCNTL_H]: Report
an error.
(__basic_socket_impl::open, __basic_socket_impl::local_endpoint)
(__basic_socket_impl::bind) [!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(__basic_socket_impl::io_control) [!_GLIBCXX_HAVE_SYS_IOCTL_H]:
Likewise.
(basic_socket::at_mark, basic_socket::shutdown)
(basic_socket::remote_endpoint, basic_socket::connect)
(basic_socket::async_connect) [!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_socket::available) [_GLIBCXX_HAVE_SYS_IOCTL_H]: Check macro
for <sys/ioctl.h> availability.
(basic_socket::wait) [!_GLIBCXX_HAVE_POLL_H]: Likewise.
(basic_datagram_socket::receive, basic_datagram_socket::async_receive)
(basic_datagram_socket::receive_from)
(basic_datagram_socket::async_receive_from)
(basic_datagram_socket::send, basic_datagram_socket::async_send)
(basic_datagram_socket::send_to, basic_datagram_socket::async_send_to)
[!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_stream_socket::receive, basic_stream_socket::async_receive)
(basic_stream_socket::send, basic_stream_socket::async_send)
[!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_socket_acceptor::listen, basic_socket_acceptor::accept)
(basic_socket_acceptor::async_accept) [!_GLIBCXX_HAVE_SYS_SOCKET_H]:
Likewise.
(basic_socket_acceptor::wait) [!_GLIBCXX_HAVE_POLL_H]: Likewise.
From-SVN: r265203
2018-10-17 00:12:32 +08:00
|
|
|
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
|
|
|
#undef HAVE_ARPA_INET_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `asinf' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_ASINF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `asinl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_ASINL
|
|
|
|
|
2009-01-08 06:49:29 +08:00
|
|
|
/* Define to 1 if the target assembler supports .symver directive. */
|
|
|
|
#undef HAVE_AS_SYMVER_DIRECTIVE
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `atan2f' function. */
|
2001-07-25 16:06:47 +08:00
|
|
|
#undef HAVE_ATAN2F
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `atan2l' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_ATAN2L
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `atanf' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_ATANF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `atanl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_ATANL
|
|
|
|
|
PR libstdc++/67843 set shared_ptr lock policy at build-time
This resolves a longstanding issue where the lock policy for shared_ptr
reference counting depends on compilation options when the header is
included, so that different -march options can cause ABI changes. For
example, objects compiled with -march=armv7 will use atomics to
synchronize reference counts, and objects compiled with -march=armv5t
will use a mutex. That means the shared_ptr control block will have a
different layout in different objects, causing ODR violations and
undefined behaviour. This was the root cause of PR libstdc++/42734 as
well as PR libstdc++/67843.
The solution is to decide on the lock policy at build time, when
libstdc++ is configured. The configure script checks for the
availability of the necessary atomic built-ins for the target and fixes
that choice permanently. Different -march flags used to compile user
code will not cause changes to the lock policy. This results in an ABI
change for certain compilations, but only where there was already an ABI
incompatibility between the libstdc++.so library and objects built with
an incompatible -march option. In general, this means a more stable ABI
that isn't silently altered when -march flags make addition atomic ops
available.
To force a target to use "atomic" or "mutex" the new configure option
--with-libstdcxx-lock-policy can be used.
In order to turn ODR violations into linker errors, the uses of
shared_ptr in filesystem directory iterators have been replaced
with __shared_ptr, and explicit instantiations are declared. This
ensures that object files using those types cannot link to libstdc++
libs unless they use the same lock policy.
PR libstdc++/67843
* acinclude.m4 (GLIBCXX_ENABLE_LOCK_POLICY): Add new macro
that defines _GLIBCXX_HAVE_ATOMIC_LOCK_POLICY.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Use GLIBCXX_ENABLE_LOCK_POLICY.
* doc/xml/manual/configure.xml: Document new configure option.
* include/bits/fs_dir.h (directory_iterator): Use __shared_ptr
instead of shared_ptr.
(recursive_directory_iterator): Likewise.
(__shared_ptr<_Dir>): Add explicit instantiation declaration.
(__shared_ptr<recursive_directory_iterator::_Dir_stack>): Likewise.
* include/bits/shared_ptr_base.h (__allocate_shared, __make_shared):
Add default template argument for _Lock_policy template parameter.
* include/ext/concurrence.h (__default_lock_policy): Check macro
_GLIBCXX_HAVE_ATOMIC_LOCK_POLICY instead of checking if the current
target supports the builtins for compare-and-swap.
* src/filesystem/std-dir.cc (__shared_ptr<_Dir>): Add explicit
instantiation definition.
(__shared_ptr<recursive_directory_iterator::_Dir_stack>): Likewise.
(directory_iterator, recursive_directory_iterator): Use __make_shared
instead of make_shared.
From-SVN: r266533
2018-11-28 07:25:56 +08:00
|
|
|
/* Defined if shared_ptr reference counting should use atomic operations. */
|
|
|
|
#undef HAVE_ATOMIC_LOCK_POLICY
|
|
|
|
|
2013-02-12 01:50:13 +08:00
|
|
|
/* Define to 1 if you have the `at_quick_exit' function. */
|
|
|
|
#undef HAVE_AT_QUICK_EXIT
|
|
|
|
|
2023-05-31 19:22:06 +08:00
|
|
|
/* Define if C99 float_t and double_t in <math.h> should be imported in
|
|
|
|
<cmath> in namespace std for C++11. */
|
|
|
|
#undef HAVE_C99_FLT_EVAL_TYPES
|
|
|
|
|
2007-08-22 09:26:43 +08:00
|
|
|
/* Define to 1 if the target assembler supports thread-local storage. */
|
|
|
|
#undef HAVE_CC_TLS
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `ceilf' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_CEILF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `ceill' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_CEILL
|
|
|
|
|
2005-01-25 23:47:35 +08:00
|
|
|
/* Define to 1 if you have the <complex.h> header file. */
|
|
|
|
#undef HAVE_COMPLEX_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `cosf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_COSF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `coshf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_COSHF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `coshl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_COSHL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `cosl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_COSL
|
|
|
|
|
2021-11-15 19:08:06 +08:00
|
|
|
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
|
|
|
|
don't. */
|
|
|
|
#undef HAVE_DECL_STRNLEN
|
|
|
|
|
2015-05-14 19:47:19 +08:00
|
|
|
/* Define to 1 if you have the <dirent.h> header file. */
|
2015-05-01 03:11:52 +08:00
|
|
|
#undef HAVE_DIRENT_H
|
|
|
|
|
libstdc++: Fix filesystem::remove_all races [PR104161]
This fixes the remaining filesystem::remove_all race condition by using
POSIX openat to recurse into sub-directories and using POSIX unlinkat to
remove files. This avoids the remaining race where the directory being
removed is replaced with a symlink after the directory has been opened,
so that the filesystem::remove("subdir/file") resolves to "target/file"
instead, because "subdir" has been removed and replaced with a symlink.
The previous patch only fixed the case where the directory was replaced
with a symlink before we tried to open it, but it still used the full
(potentially compromised) path as an argument to filesystem::remove.
The first part of the fix is to use openat when recursing into a
sub-directory with recursive_directory_iterator. This means that opening
"dir/subdir" uses the file descriptor for "dir", and so is sure to open
"dir/subdir" and not "symlink/subdir". (The previous patch to use
O_NOFOLLOW already ensured we won't open "dir/symlink/" here.)
The second part of the fix is to use unlinkat for the remove_all
operation. Previously we used a directory_iterator to get the name of
each file in a directory and then used filesystem::remove(iter->path())
on that name. This meant that any checks (e.g. O_NOFOLLOW) done by the
iterator could be invalidated before the remove operation on that
pathname. The directory iterator contains an open DIR stream, which we
can use to obtain a file descriptor to pass to unlinkat. This ensures
that the file being deleted really is contained within the directory
we're iterating over, rather than using a pathname that could resolve to
some other file.
The filesystem::remove_all function previously used a (non-recursive)
filesystem::directory_iterator for each directory, and called itself
recursively for sub-directories. The new implementation uses a single
filesystem::recursive_directory_iterator object, and calls a new __erase
member function on that iterator. That new __erase member function does
the actual work of removing a file (or a directory after its contents
have been iterated over and removed) using unlinkat. That means we don't
need to expose the DIR stream or its file descriptor to the remove_all
function, it's still encapuslated by the iterator class.
It would be possible to add a __rewind member to directory iterators
too, to call rewinddir after each modification to the directory. That
would make it more likely for filesystem::remove_all to successfully
remove everything even if files are being written to the directory tree
while removing it. It's unclear if that is actually prefereable, or if
it's better to fail and report an error at the first opportunity.
The necessary APIs (openat, unlinkat, fdopendir, dirfd) are defined in
POSIX.1-2008, and in Glibc since 2.10. But if the target doesn't provide
them, the original code (with race conditions) is still used.
This also reduces the number of small memory allocations needed for
std::filesystem::remove_all, because we do not store the full path to
every directory entry that is iterated over. The new filename_only
option means we only store the filename in the directory entry, as that
is all we need in order to use openat or unlinkat.
Finally, rather than duplicating everything for the Filesystem TS, the
std::experimental::filesystem::remove_all implementation now just calls
std::filesystem::remove_all to do the work.
libstdc++-v3/ChangeLog:
PR libstdc++/104161
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for dirfd
and unlinkat.
* config.h.in: Regenerate.
* configure: Regenerate.
* include/bits/fs_dir.h (recursive_directory_iterator): Declare
remove_all overloads as friends.
(recursive_directory_iterator::__erase): Declare new member
function.
* include/bits/fs_fwd.h (remove, remove_all): Declare.
* src/c++17/fs_dir.cc (_Dir): Add filename_only parameter to
constructor. Pass file descriptor argument to base constructor.
(_Dir::dir_and_pathname, _Dir::open_subdir, _Dir::do_unlink)
(_Dir::unlink, _Dir::rmdir): Define new member functions.
(directory_iterator): Pass filename_only argument to _Dir
constructor.
(recursive_directory_iterator::_Dir_stack): Adjust constructor
parameters to take a _Dir rvalue instead of creating one.
(_Dir_stack::orig): Add data member for storing original path.
(_Dir_stack::report_error): Define new member function.
(__directory_iterator_nofollow): Move here from dir-common.h and
fix value to be a power of two.
(__directory_iterator_filename_only): Define new constant.
(recursive_directory_iterator): Construct _Dir object and move
into _M_dirs stack. Pass skip_permission_denied argument to first
advance call.
(recursive_directory_iterator::increment): Use _Dir::open_subdir.
(recursive_directory_iterator::__erase): Define new member
function.
* src/c++17/fs_ops.cc (ErrorReporter, do_remove_all): Remove.
(fs::remove_all): Use new recursive_directory_iterator::__erase
member function.
* src/filesystem/dir-common.h (_Dir_base): Add int parameter to
constructor and use openat to implement nofollow semantics.
(_Dir_base::fdcwd, _Dir_base::set_close_on_exec, _Dir_base::openat):
Define new member functions.
(__directory_iterator_nofollow): Move to fs_dir.cc.
* src/filesystem/dir.cc (_Dir): Pass file descriptor argument to
base constructor.
(_Dir::dir_and_pathname, _Dir::open_subdir): Define new member
functions.
(recursive_directory_iterator::_Dir_stack): Adjust constructor
parameters to take a _Dir rvalue instead of creating one.
(recursive_directory_iterator): Check for new nofollow option.
Construct _Dir object and move into _M_dirs stack. Pass
skip_permission_denied argument to first advance call.
(recursive_directory_iterator::increment): Use _Dir::open_subdir.
* src/filesystem/ops.cc (fs::remove_all): Use C++17 remove_all.
2022-02-02 06:04:46 +08:00
|
|
|
/* Define if dirfd is available in <dirent.h>. */
|
|
|
|
#undef HAVE_DIRFD
|
|
|
|
|
2007-05-29 01:02:30 +08:00
|
|
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
|
|
|
#undef HAVE_DLFCN_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <endian.h> header file. */
|
|
|
|
#undef HAVE_ENDIAN_H
|
|
|
|
|
2017-01-04 18:54:59 +08:00
|
|
|
/* Define to 1 if GCC 4.6 supported std::exception_ptr for the target */
|
|
|
|
#undef HAVE_EXCEPTION_PTR_SINCE_GCC46
|
|
|
|
|
2010-01-13 19:07:44 +08:00
|
|
|
/* Define to 1 if you have the <execinfo.h> header file. */
|
|
|
|
#undef HAVE_EXECINFO_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `expf' function. */
|
2002-03-23 11:19:03 +08:00
|
|
|
#undef HAVE_EXPF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `expl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_EXPL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `fabsf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_FABSF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `fabsl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_FABSL
|
|
|
|
|
2015-05-01 03:11:52 +08:00
|
|
|
/* Define to 1 if you have the <fcntl.h> header file. */
|
|
|
|
#undef HAVE_FCNTL_H
|
|
|
|
|
2022-01-24 05:45:16 +08:00
|
|
|
/* Define if fdopendir is available in <dirent.h>. */
|
|
|
|
#undef HAVE_FDOPENDIR
|
|
|
|
|
2006-01-26 19:29:20 +08:00
|
|
|
/* Define to 1 if you have the <fenv.h> header file. */
|
|
|
|
#undef HAVE_FENV_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `finite' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_FINITE
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `finitef' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_FINITEF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `finitel' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_FINITEL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <float.h> header file. */
|
|
|
|
#undef HAVE_FLOAT_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `floorf' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_FLOORF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `floorl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_FLOORL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `fmodf' function. */
|
2000-06-14 09:16:03 +08:00
|
|
|
#undef HAVE_FMODF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `fmodl' function. */
|
2000-06-14 09:16:03 +08:00
|
|
|
#undef HAVE_FMODL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `fpclass' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_FPCLASS
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <fp.h> header file. */
|
|
|
|
#undef HAVE_FP_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `frexpf' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_FREXPF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `frexpl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_FREXPL
|
|
|
|
|
2021-11-04 23:51:37 +08:00
|
|
|
/* Define if getentropy is available in <unistd.h>. */
|
|
|
|
#undef HAVE_GETENTROPY
|
|
|
|
|
2006-07-22 05:11:46 +08:00
|
|
|
/* Define if _Unwind_GetIPInfo is available. */
|
|
|
|
#undef HAVE_GETIPINFO
|
|
|
|
|
2016-10-01 02:28:53 +08:00
|
|
|
/* Define if gets is available in <stdio.h> before C++14. */
|
2012-03-02 15:13:55 +08:00
|
|
|
#undef HAVE_GETS
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `hypot' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_HYPOT
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `hypotf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_HYPOTF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `hypotl' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_HYPOTL
|
|
|
|
|
2023-11-17 22:38:56 +08:00
|
|
|
/* Define if you have the iconv() function and it works. */
|
2000-06-02 15:24:15 +08:00
|
|
|
#undef HAVE_ICONV
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <ieeefp.h> header file. */
|
|
|
|
#undef HAVE_IEEEFP_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
|
|
#undef HAVE_INTTYPES_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `isinf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_ISINF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `isinff' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_ISINFF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `isinfl' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_ISINFL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `isnan' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_ISNAN
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `isnanf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_ISNANF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `isnanl' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_ISNANL
|
|
|
|
|
2005-03-24 13:45:45 +08:00
|
|
|
/* Defined if iswblank exists. */
|
2003-10-17 04:33:43 +08:00
|
|
|
#undef HAVE_ISWBLANK
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if LC_MESSAGES is available in <locale.h>. */
|
|
|
|
#undef HAVE_LC_MESSAGES
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `ldexpf' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_LDEXPF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `ldexpl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_LDEXPL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <libintl.h> header file. */
|
|
|
|
#undef HAVE_LIBINTL_H
|
|
|
|
|
2004-04-01 17:16:36 +08:00
|
|
|
/* Only used in build directory testsuite_hooks.h. */
|
|
|
|
#undef HAVE_LIMIT_AS
|
|
|
|
|
|
|
|
/* Only used in build directory testsuite_hooks.h. */
|
|
|
|
#undef HAVE_LIMIT_DATA
|
|
|
|
|
|
|
|
/* Only used in build directory testsuite_hooks.h. */
|
|
|
|
#undef HAVE_LIMIT_FSIZE
|
|
|
|
|
|
|
|
/* Only used in build directory testsuite_hooks.h. */
|
|
|
|
#undef HAVE_LIMIT_RSS
|
|
|
|
|
|
|
|
/* Only used in build directory testsuite_hooks.h. */
|
|
|
|
#undef HAVE_LIMIT_VMEM
|
|
|
|
|
2018-06-19 00:01:24 +08:00
|
|
|
/* Define if link is available in <unistd.h>. */
|
PR libstdc++/78870 support std::filesystem on Windows
PR libstdc++/78870 support std::filesystem on Windows
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check for link, readlink and symlink.
* include/bits/fs_path.h (path::operator/=(const path&)): Move
definition out of class body.
(path::is_absolute(), path::_M_append(path)): Likewise.
(operator<<(basic_ostream, const path&)): Use std::quoted directly.
(operator>>(basic_istream, path&)): Likewise.
(u8path): Reorder definitions and fix Windows implementation.
(path::is_absolute()): Define inline and fix for Windows.
[!_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::operator/=(const path&)):
Define POSIX version inline.
(path::_M_append(path)): Define inline.
* include/experimental/bits/fs_path.h (path::is_absolute()): Move
definition out of class body.
(operator<<(basic_ostream, const path&)): Fix type of delimiter and
escape characters.
(operator>>(basic_istream, path&)): Likewise.
(path::is_absolute()): Define inline and fix for Windows.
* src/filesystem/dir-common.h (__gnu_posix): New namespace.
(__gnu_posix::char_type, __gnu_posix::DIR, __gnu_posix::dirent)
(__gnu_posix::opendir, __gnu_posix::readdir, __gnu_posix::closedir):
Define as adaptors for Windows functions/types or as
using-declarations for POSIX functions/types.
(_Dir_base, get_file_type): Qualify names to use declarations from
__gnu_posix namespace.
(_Dir_base::is_dor_or_dotdot): New helper functions.
* src/filesystem/dir.cc (_Dir, recursive_directory_iterator): Qualify
names to use declarations from __gnu_posix namespace.
* src/filesystem/ops-common.h (__gnu_posix): New nested namespace.
(__gnu_posix::open, __gnu_posix::close, __gnu_posix::stat_type)
(__gnu_posix::stat, __gnu_posix::lstat, __gnu_posix::mode_t)
(__gnu_posix::chmod, __gnu_posix::mkdir, __gnu_posix::getcwd)
(__gnu_posix::chdir, __gnu_posix::utimbuf, __gnu_posix::utime)
(__gnu_posix::rename, __gnu_posix::truncate, __gnu_posix::char_type):
Define as adaptors for Windows functions/types or as
using-declarations for POSIX functions/types.
(stat_type, do_copy_file): Qualify names to use declarations from
__gnu_posix namespace.
(do_space): Declare new function.
(make_file_type): Only use S_ISLNK if defined.
* src/filesystem/ops.cc (char_ptr, filesystem::canonical): Use
path::value_type not char.
(filesystem::copy, create_dir, filesystem::create_directory): Qualify
names to use declarations from __gnu_posix namespace.
(filesystem::create_hard_link): Check HAVE_LINK autoconf macro and
add implementation for Windows.
(filesystem::create_symlink): Check HAVE_SYMLINK autoconf macro.
(filesystem::current_path(error_code&)): Use __gnu_posix::getcwd.
[!_PC_PATH_MAX]: Don't use pathconf.
[PATH_MAX]: Use if defined.
(filesystem::current_path(const path&, error_code&))
(filesystem::equivalent, do_stat, filesystem::hard_link_count)
(filesystem::last_write_time, filesystem::permissions): Use names
from __gnu_posix.
(filesystem::read_symlink): Check HAVE_READLINK autoconf macro.
(filesystem::remove) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Add
implementation for Windows.
(filesystem::rename, filesystem::resize_file): Use names from
__gnu_posix.
(filesystem::space): Use do_space.
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Get absolute path to directory.
(filesystem::status, filesystem::symlink_status): Use names from
__gnu_posix.
(filesystem::temp_directory_path): Add implementation for Windows.
* src/filesystem/path.cc (dot): Define constant.
(path::replace_extension): Use dot.
(path::_M_find_extension): Likewise. Use path::string_type not
std::string.
(path::_M_split_cmpts): Use dot.
(filesystem_error::_M_get_what): Use u8string() not native().
* src/filesystem/std-dir.cc (_Dir, recursive_directory_iterator):
Qualify names to use declarations from __gnu_posix namespace.
* src/filesystem/std-ops.cc (filesystem::absolute(const path&)): Use
correct error_code.
(filesystem::absolute(const path&, error_code&)): Add implementation
for Windows.
(char_ptr, filesystem::canonical): Use path::value_type not char.
(do_copy_file): Use names from __gnu_posix.
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Do not use fchmod, fchmodat or
sendfile.
(filesystem::copy, create_dir, filesystem::create_directory): Qualify
names to use declarations from __gnu_posix namespace.
(filesystem::create_hard_link): Check HAVE_LINK autoconf macro and
add implementation for Windows.
(filesystem::create_symlink): Check HAVE_SYMLINK autoconf macro.
(filesystem::current_path(error_code&)): Use __gnu_posix::getcwd.
[!_PC_PATH_MAX]: Don't use pathconf.
[PATH_MAX]: Use if defined.
(filesystem::current_path(const path&, error_code&))
(filesystem::equivalent, do_stat, filesystem::hard_link_count)
(filesystem::last_write_time, filesystem::permissions): Use names
from __gnu_posix.
(filesystem::read_symlink): Check HAVE_READLINK autoconf macro.
(filesystem::remove) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Add
implementation for Windows.
(filesystem::rename, filesystem::resize_file): Use names from
__gnu_posix.
(do_space): Define.
(filesystem::space): Use do_space.
(filesystem::status, filesystem::symlink_status): Use names from
__gnu_posix.
(filesystem::temp_directory_path): Add implementation for Windows.
* src/filesystem/std-path.cc
[_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::operator/=(const path&)):
Define for Windows.
(dot): Define constant.
(path::replace_extension, is_dot): Use dot.
(path::lexically_normal): Check _M_type instead of calling
non-existent function.
(path::_M_find_extension): Use dot. Use path::string_type not
std::string.
(path::_M_split_cmpts): Use dot.
(filesystem_error::_M_get_what): Use u8string() not native().
* testsuite/27_io/filesystem/iterators/directory_iterator.cc: Do not
use symlinks.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
Likewise.
* testsuite/27_io/filesystem/operations/absolute.cc: Use
__gnu_test::root_path() instead of "/" and add Windows-specific tests.
* testsuite/27_io/filesystem/operations/canonical.cc: Use
path::string() to get narrow string, not path::native().
* testsuite/27_io/filesystem/operations/copy.cc: Construct fstreams
with std::filesystem::path not std::basic_string.
* testsuite/27_io/filesystem/operations/copy_file.cc: Likewise.
* testsuite/27_io/filesystem/operations/exists.cc: Use
__gnu_test::root_path() instead of "/".
* testsuite/27_io/filesystem/operations/is_empty.cc: Construct
fstreams with std::filesystem::path not std::basic_string.
* testsuite/27_io/filesystem/operations/last_write_time.cc: Use
path::string() to get narrow string.
* testsuite/27_io/filesystem/operations/space.cc: Check results for
errors, expect sensible values otherwise.
* testsuite/27_io/filesystem/operations/temp_directory_path.cc: Add
helpers for adjusting the environment on Windows.
* testsuite/27_io/filesystem/path/append/path.cc: Test
Windows-specific behaviour.
* testsuite/27_io/filesystem/path/construct/format.cc: Fix creation
of path::string_type objects.
* testsuite/27_io/filesystem/path/construct/locale.cc: Compare native
string to wide string on Windows.
* testsuite/27_io/filesystem/path/decompose/root_directory.cc: Allow
for backslash as root-directory.
* testsuite/27_io/filesystem/path/decompose/stem.cc: Use
path::string() to get narrow string.
* testsuite/27_io/filesystem/path/itr/traversal.cc: Test Windows-style
paths.
* testsuite/27_io/filesystem/path/native/string.cc: Use string_type
not std::string.
* testsuite/27_io/filesystem/path/query/is_absolute.cc: Adjust for
different definintion of absolute paths on Windows.
* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
Do not use symlinks.
* testsuite/experimental/filesystem/operations/absolute.cc: Test
Windows behaviour.
* testsuite/experimental/filesystem/operations/copy.cc: Construct
fstreams with NTCTS not std::basic_string.
* testsuite/experimental/filesystem/operations/copy_file.cc: Likewise.
* testsuite/experimental/filesystem/operations/exists.cc: Use
__gnu_test::root_path() instead of "/".
* testsuite/experimental/filesystem/operations/is_empty.cc: Construct
fstreams with NTCTS not std::basic_string.
* testsuite/experimental/filesystem/operations/last_write_time.cc:
Use path::string() to get narrow string.
* testsuite/experimental/filesystem/operations/space.cc: Use
__gnu_test::root_path() instead of "/".
* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
Add helpers for adjusting the environment on Windows.
* testsuite/experimental/filesystem/path/append/path.cc: Use
path::string() to get narrow strings for comparisons.
* testsuite/experimental/filesystem/path/concat/path.cc: Likewise.
* testsuite/experimental/filesystem/path/decompose/root_directory.cc:
Likewise.
* testsuite/experimental/filesystem/path/decompose/stem.cc: Likewise.
* testsuite/experimental/filesystem/path/native/string.cc: Use
string_type not std::string.
* testsuite/experimental/filesystem/path/query/is_absolute.cc:
Adjust for different definintion of absolute paths on Windows.
* testsuite/util/testsuite_fs.h (__gnu_test::root_path()): New
function.
(__gnu_test::scoped_file): Construct fstreams with NTCTS not
std::basic_string.
From-SVN: r261034
2018-06-01 03:20:24 +08:00
|
|
|
#undef HAVE_LINK
|
|
|
|
|
2021-11-15 19:08:06 +08:00
|
|
|
/* Define to 1 if you have the <link.h> header file. */
|
|
|
|
#undef HAVE_LINK_H
|
|
|
|
|
2008-01-09 00:14:49 +08:00
|
|
|
/* Define if futex syscall is available. */
|
|
|
|
#undef HAVE_LINUX_FUTEX
|
|
|
|
|
2017-05-24 00:11:57 +08:00
|
|
|
/* Define to 1 if you have the <linux/random.h> header file. */
|
|
|
|
#undef HAVE_LINUX_RANDOM_H
|
|
|
|
|
2018-01-19 03:52:16 +08:00
|
|
|
/* Define to 1 if you have the <linux/types.h> header file. */
|
|
|
|
#undef HAVE_LINUX_TYPES_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <locale.h> header file. */
|
|
|
|
#undef HAVE_LOCALE_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `log10f' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_LOG10F
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `log10l' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_LOG10L
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `logf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_LOGF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `logl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_LOGL
|
|
|
|
|
2023-03-07 03:52:08 +08:00
|
|
|
/* Define if lseek is available in <unistd.h>. */
|
|
|
|
#undef HAVE_LSEEK
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <machine/endian.h> header file. */
|
|
|
|
#undef HAVE_MACHINE_ENDIAN_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <machine/param.h> header file. */
|
|
|
|
#undef HAVE_MACHINE_PARAM_H
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if mbstate_t exists in wchar.h. */
|
|
|
|
#undef HAVE_MBSTATE_T
|
|
|
|
|
2016-09-10 05:22:15 +08:00
|
|
|
/* Define to 1 if you have the `memalign' function. */
|
|
|
|
#undef HAVE_MEMALIGN
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <memory.h> header file. */
|
|
|
|
#undef HAVE_MEMORY_H
|
|
|
|
|
2005-04-05 11:11:32 +08:00
|
|
|
/* Define to 1 if you have the `modf' function. */
|
|
|
|
#undef HAVE_MODF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `modff' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_MODFF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `modfl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_MODFL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <nan.h> header file. */
|
|
|
|
#undef HAVE_NAN_H
|
|
|
|
|
Use autoconf to check for features needed by Networking TS
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check for headers used by Networking TS.
* include/experimental/executor: Include <condition_variable>
instead of <mutex>.
* include/experimental/internet: Use autoconf macros for available
headers. Include <sys/socket.h> for. Remove <cstring> and use
__builtin_memcpy and __builtin_strchr.
(resolver_errc) [!_GLIBCXX_HAVE_NETDB_H]: Do not define.
(address_v4::to_string, address_v6::to_string)
[!_GLIBCXX_HAVE_ARPA_INET_H]: Likewise.
(basic_resolver_results) [!_GLIBCXX_HAVE_NETDB_H]: Make private
constructors report errors.
[!_GLIBCXX_HAVE_NETINET_TCP_H] (tcp::no_delay): Do not define.
* include/experimental/io_context: Likewise.
* include/experimental/socket: Likewise.
[!_GLIBCXX_HAVE_SYS_SOCKET_H, !_GLIBCXX_HAVE_POLL_H] (socket_base): Do
not define nested types when relevant header not available.
(__socket_impl::native_non_blocking) [!_GLIBCXX_HAVE_FCNTL_H]: Report
an error.
(__basic_socket_impl::open, __basic_socket_impl::local_endpoint)
(__basic_socket_impl::bind) [!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(__basic_socket_impl::io_control) [!_GLIBCXX_HAVE_SYS_IOCTL_H]:
Likewise.
(basic_socket::at_mark, basic_socket::shutdown)
(basic_socket::remote_endpoint, basic_socket::connect)
(basic_socket::async_connect) [!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_socket::available) [_GLIBCXX_HAVE_SYS_IOCTL_H]: Check macro
for <sys/ioctl.h> availability.
(basic_socket::wait) [!_GLIBCXX_HAVE_POLL_H]: Likewise.
(basic_datagram_socket::receive, basic_datagram_socket::async_receive)
(basic_datagram_socket::receive_from)
(basic_datagram_socket::async_receive_from)
(basic_datagram_socket::send, basic_datagram_socket::async_send)
(basic_datagram_socket::send_to, basic_datagram_socket::async_send_to)
[!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_stream_socket::receive, basic_stream_socket::async_receive)
(basic_stream_socket::send, basic_stream_socket::async_send)
[!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_socket_acceptor::listen, basic_socket_acceptor::accept)
(basic_socket_acceptor::async_accept) [!_GLIBCXX_HAVE_SYS_SOCKET_H]:
Likewise.
(basic_socket_acceptor::wait) [!_GLIBCXX_HAVE_POLL_H]: Likewise.
From-SVN: r265203
2018-10-17 00:12:32 +08:00
|
|
|
/* Define to 1 if you have the <netdb.h> header file. */
|
|
|
|
#undef HAVE_NETDB_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <netinet/in.h> header file. */
|
|
|
|
#undef HAVE_NETINET_IN_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
|
|
|
#undef HAVE_NETINET_TCP_H
|
|
|
|
|
2016-01-28 21:09:23 +08:00
|
|
|
/* Define if <math.h> defines obsolete isinf function. */
|
|
|
|
#undef HAVE_OBSOLETE_ISINF
|
|
|
|
|
|
|
|
/* Define if <math.h> defines obsolete isnan function. */
|
|
|
|
#undef HAVE_OBSOLETE_ISNAN
|
2016-01-14 00:25:56 +08:00
|
|
|
|
2022-06-24 10:20:53 +08:00
|
|
|
/* Define if openat is available in <fcntl.h>. */
|
|
|
|
#undef HAVE_OPENAT
|
|
|
|
|
2024-08-28 19:38:18 +08:00
|
|
|
/* Define if O_NONBLOCK is defined in <fcntl.h> */
|
|
|
|
#undef HAVE_O_NONBLOCK
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if poll is available in <poll.h>. */
|
|
|
|
#undef HAVE_POLL
|
|
|
|
|
Use autoconf to check for features needed by Networking TS
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check for headers used by Networking TS.
* include/experimental/executor: Include <condition_variable>
instead of <mutex>.
* include/experimental/internet: Use autoconf macros for available
headers. Include <sys/socket.h> for. Remove <cstring> and use
__builtin_memcpy and __builtin_strchr.
(resolver_errc) [!_GLIBCXX_HAVE_NETDB_H]: Do not define.
(address_v4::to_string, address_v6::to_string)
[!_GLIBCXX_HAVE_ARPA_INET_H]: Likewise.
(basic_resolver_results) [!_GLIBCXX_HAVE_NETDB_H]: Make private
constructors report errors.
[!_GLIBCXX_HAVE_NETINET_TCP_H] (tcp::no_delay): Do not define.
* include/experimental/io_context: Likewise.
* include/experimental/socket: Likewise.
[!_GLIBCXX_HAVE_SYS_SOCKET_H, !_GLIBCXX_HAVE_POLL_H] (socket_base): Do
not define nested types when relevant header not available.
(__socket_impl::native_non_blocking) [!_GLIBCXX_HAVE_FCNTL_H]: Report
an error.
(__basic_socket_impl::open, __basic_socket_impl::local_endpoint)
(__basic_socket_impl::bind) [!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(__basic_socket_impl::io_control) [!_GLIBCXX_HAVE_SYS_IOCTL_H]:
Likewise.
(basic_socket::at_mark, basic_socket::shutdown)
(basic_socket::remote_endpoint, basic_socket::connect)
(basic_socket::async_connect) [!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_socket::available) [_GLIBCXX_HAVE_SYS_IOCTL_H]: Check macro
for <sys/ioctl.h> availability.
(basic_socket::wait) [!_GLIBCXX_HAVE_POLL_H]: Likewise.
(basic_datagram_socket::receive, basic_datagram_socket::async_receive)
(basic_datagram_socket::receive_from)
(basic_datagram_socket::async_receive_from)
(basic_datagram_socket::send, basic_datagram_socket::async_send)
(basic_datagram_socket::send_to, basic_datagram_socket::async_send_to)
[!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_stream_socket::receive, basic_stream_socket::async_receive)
(basic_stream_socket::send, basic_stream_socket::async_send)
[!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_socket_acceptor::listen, basic_socket_acceptor::accept)
(basic_socket_acceptor::async_accept) [!_GLIBCXX_HAVE_SYS_SOCKET_H]:
Likewise.
(basic_socket_acceptor::wait) [!_GLIBCXX_HAVE_POLL_H]: Likewise.
From-SVN: r265203
2018-10-17 00:12:32 +08:00
|
|
|
/* Define to 1 if you have the <poll.h> header file. */
|
|
|
|
#undef HAVE_POLL_H
|
|
|
|
|
2016-09-10 05:22:15 +08:00
|
|
|
/* Define to 1 if you have the `posix_memalign' function. */
|
|
|
|
#undef HAVE_POSIX_MEMALIGN
|
|
|
|
|
2021-04-21 17:09:25 +08:00
|
|
|
/* Define to 1 if POSIX Semaphores with sem_timedwait are available in
|
|
|
|
<semaphore.h>. */
|
|
|
|
#undef HAVE_POSIX_SEMAPHORE
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `powf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_POWF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `powl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_POWL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `qfpclass' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_QFPCLASS
|
|
|
|
|
2013-02-12 01:50:13 +08:00
|
|
|
/* Define to 1 if you have the `quick_exit' function. */
|
|
|
|
#undef HAVE_QUICK_EXIT
|
|
|
|
|
2018-06-19 00:01:24 +08:00
|
|
|
/* Define if readlink is available in <unistd.h>. */
|
PR libstdc++/78870 support std::filesystem on Windows
PR libstdc++/78870 support std::filesystem on Windows
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check for link, readlink and symlink.
* include/bits/fs_path.h (path::operator/=(const path&)): Move
definition out of class body.
(path::is_absolute(), path::_M_append(path)): Likewise.
(operator<<(basic_ostream, const path&)): Use std::quoted directly.
(operator>>(basic_istream, path&)): Likewise.
(u8path): Reorder definitions and fix Windows implementation.
(path::is_absolute()): Define inline and fix for Windows.
[!_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::operator/=(const path&)):
Define POSIX version inline.
(path::_M_append(path)): Define inline.
* include/experimental/bits/fs_path.h (path::is_absolute()): Move
definition out of class body.
(operator<<(basic_ostream, const path&)): Fix type of delimiter and
escape characters.
(operator>>(basic_istream, path&)): Likewise.
(path::is_absolute()): Define inline and fix for Windows.
* src/filesystem/dir-common.h (__gnu_posix): New namespace.
(__gnu_posix::char_type, __gnu_posix::DIR, __gnu_posix::dirent)
(__gnu_posix::opendir, __gnu_posix::readdir, __gnu_posix::closedir):
Define as adaptors for Windows functions/types or as
using-declarations for POSIX functions/types.
(_Dir_base, get_file_type): Qualify names to use declarations from
__gnu_posix namespace.
(_Dir_base::is_dor_or_dotdot): New helper functions.
* src/filesystem/dir.cc (_Dir, recursive_directory_iterator): Qualify
names to use declarations from __gnu_posix namespace.
* src/filesystem/ops-common.h (__gnu_posix): New nested namespace.
(__gnu_posix::open, __gnu_posix::close, __gnu_posix::stat_type)
(__gnu_posix::stat, __gnu_posix::lstat, __gnu_posix::mode_t)
(__gnu_posix::chmod, __gnu_posix::mkdir, __gnu_posix::getcwd)
(__gnu_posix::chdir, __gnu_posix::utimbuf, __gnu_posix::utime)
(__gnu_posix::rename, __gnu_posix::truncate, __gnu_posix::char_type):
Define as adaptors for Windows functions/types or as
using-declarations for POSIX functions/types.
(stat_type, do_copy_file): Qualify names to use declarations from
__gnu_posix namespace.
(do_space): Declare new function.
(make_file_type): Only use S_ISLNK if defined.
* src/filesystem/ops.cc (char_ptr, filesystem::canonical): Use
path::value_type not char.
(filesystem::copy, create_dir, filesystem::create_directory): Qualify
names to use declarations from __gnu_posix namespace.
(filesystem::create_hard_link): Check HAVE_LINK autoconf macro and
add implementation for Windows.
(filesystem::create_symlink): Check HAVE_SYMLINK autoconf macro.
(filesystem::current_path(error_code&)): Use __gnu_posix::getcwd.
[!_PC_PATH_MAX]: Don't use pathconf.
[PATH_MAX]: Use if defined.
(filesystem::current_path(const path&, error_code&))
(filesystem::equivalent, do_stat, filesystem::hard_link_count)
(filesystem::last_write_time, filesystem::permissions): Use names
from __gnu_posix.
(filesystem::read_symlink): Check HAVE_READLINK autoconf macro.
(filesystem::remove) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Add
implementation for Windows.
(filesystem::rename, filesystem::resize_file): Use names from
__gnu_posix.
(filesystem::space): Use do_space.
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Get absolute path to directory.
(filesystem::status, filesystem::symlink_status): Use names from
__gnu_posix.
(filesystem::temp_directory_path): Add implementation for Windows.
* src/filesystem/path.cc (dot): Define constant.
(path::replace_extension): Use dot.
(path::_M_find_extension): Likewise. Use path::string_type not
std::string.
(path::_M_split_cmpts): Use dot.
(filesystem_error::_M_get_what): Use u8string() not native().
* src/filesystem/std-dir.cc (_Dir, recursive_directory_iterator):
Qualify names to use declarations from __gnu_posix namespace.
* src/filesystem/std-ops.cc (filesystem::absolute(const path&)): Use
correct error_code.
(filesystem::absolute(const path&, error_code&)): Add implementation
for Windows.
(char_ptr, filesystem::canonical): Use path::value_type not char.
(do_copy_file): Use names from __gnu_posix.
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Do not use fchmod, fchmodat or
sendfile.
(filesystem::copy, create_dir, filesystem::create_directory): Qualify
names to use declarations from __gnu_posix namespace.
(filesystem::create_hard_link): Check HAVE_LINK autoconf macro and
add implementation for Windows.
(filesystem::create_symlink): Check HAVE_SYMLINK autoconf macro.
(filesystem::current_path(error_code&)): Use __gnu_posix::getcwd.
[!_PC_PATH_MAX]: Don't use pathconf.
[PATH_MAX]: Use if defined.
(filesystem::current_path(const path&, error_code&))
(filesystem::equivalent, do_stat, filesystem::hard_link_count)
(filesystem::last_write_time, filesystem::permissions): Use names
from __gnu_posix.
(filesystem::read_symlink): Check HAVE_READLINK autoconf macro.
(filesystem::remove) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Add
implementation for Windows.
(filesystem::rename, filesystem::resize_file): Use names from
__gnu_posix.
(do_space): Define.
(filesystem::space): Use do_space.
(filesystem::status, filesystem::symlink_status): Use names from
__gnu_posix.
(filesystem::temp_directory_path): Add implementation for Windows.
* src/filesystem/std-path.cc
[_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::operator/=(const path&)):
Define for Windows.
(dot): Define constant.
(path::replace_extension, is_dot): Use dot.
(path::lexically_normal): Check _M_type instead of calling
non-existent function.
(path::_M_find_extension): Use dot. Use path::string_type not
std::string.
(path::_M_split_cmpts): Use dot.
(filesystem_error::_M_get_what): Use u8string() not native().
* testsuite/27_io/filesystem/iterators/directory_iterator.cc: Do not
use symlinks.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
Likewise.
* testsuite/27_io/filesystem/operations/absolute.cc: Use
__gnu_test::root_path() instead of "/" and add Windows-specific tests.
* testsuite/27_io/filesystem/operations/canonical.cc: Use
path::string() to get narrow string, not path::native().
* testsuite/27_io/filesystem/operations/copy.cc: Construct fstreams
with std::filesystem::path not std::basic_string.
* testsuite/27_io/filesystem/operations/copy_file.cc: Likewise.
* testsuite/27_io/filesystem/operations/exists.cc: Use
__gnu_test::root_path() instead of "/".
* testsuite/27_io/filesystem/operations/is_empty.cc: Construct
fstreams with std::filesystem::path not std::basic_string.
* testsuite/27_io/filesystem/operations/last_write_time.cc: Use
path::string() to get narrow string.
* testsuite/27_io/filesystem/operations/space.cc: Check results for
errors, expect sensible values otherwise.
* testsuite/27_io/filesystem/operations/temp_directory_path.cc: Add
helpers for adjusting the environment on Windows.
* testsuite/27_io/filesystem/path/append/path.cc: Test
Windows-specific behaviour.
* testsuite/27_io/filesystem/path/construct/format.cc: Fix creation
of path::string_type objects.
* testsuite/27_io/filesystem/path/construct/locale.cc: Compare native
string to wide string on Windows.
* testsuite/27_io/filesystem/path/decompose/root_directory.cc: Allow
for backslash as root-directory.
* testsuite/27_io/filesystem/path/decompose/stem.cc: Use
path::string() to get narrow string.
* testsuite/27_io/filesystem/path/itr/traversal.cc: Test Windows-style
paths.
* testsuite/27_io/filesystem/path/native/string.cc: Use string_type
not std::string.
* testsuite/27_io/filesystem/path/query/is_absolute.cc: Adjust for
different definintion of absolute paths on Windows.
* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
Do not use symlinks.
* testsuite/experimental/filesystem/operations/absolute.cc: Test
Windows behaviour.
* testsuite/experimental/filesystem/operations/copy.cc: Construct
fstreams with NTCTS not std::basic_string.
* testsuite/experimental/filesystem/operations/copy_file.cc: Likewise.
* testsuite/experimental/filesystem/operations/exists.cc: Use
__gnu_test::root_path() instead of "/".
* testsuite/experimental/filesystem/operations/is_empty.cc: Construct
fstreams with NTCTS not std::basic_string.
* testsuite/experimental/filesystem/operations/last_write_time.cc:
Use path::string() to get narrow string.
* testsuite/experimental/filesystem/operations/space.cc: Use
__gnu_test::root_path() instead of "/".
* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
Add helpers for adjusting the environment on Windows.
* testsuite/experimental/filesystem/path/append/path.cc: Use
path::string() to get narrow strings for comparisons.
* testsuite/experimental/filesystem/path/concat/path.cc: Likewise.
* testsuite/experimental/filesystem/path/decompose/root_directory.cc:
Likewise.
* testsuite/experimental/filesystem/path/decompose/stem.cc: Likewise.
* testsuite/experimental/filesystem/path/native/string.cc: Use
string_type not std::string.
* testsuite/experimental/filesystem/path/query/is_absolute.cc:
Adjust for different definintion of absolute paths on Windows.
* testsuite/util/testsuite_fs.h (__gnu_test::root_path()): New
function.
(__gnu_test::scoped_file): Construct fstreams with NTCTS not
std::basic_string.
From-SVN: r261034
2018-06-01 03:20:24 +08:00
|
|
|
#undef HAVE_READLINK
|
|
|
|
|
2021-07-30 20:56:14 +08:00
|
|
|
/* Define to 1 if you have the `secure_getenv' function. */
|
|
|
|
#undef HAVE_SECURE_GETENV
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `setenv' function. */
|
2002-01-25 04:46:34 +08:00
|
|
|
#undef HAVE_SETENV
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `sincos' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_SINCOS
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `sincosf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_SINCOSF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `sincosl' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_SINCOSL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `sinf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_SINF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `sinhf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_SINHF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `sinhl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_SINHL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `sinl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_SINL
|
|
|
|
|
2012-11-24 06:11:23 +08:00
|
|
|
/* Defined if sleep exists. */
|
|
|
|
#undef HAVE_SLEEP
|
|
|
|
|
2019-03-12 00:28:11 +08:00
|
|
|
/* Define to 1 if you have the `sockatmark' function. */
|
|
|
|
#undef HAVE_SOCKATMARK
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `sqrtf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_SQRTF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `sqrtl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_SQRTL
|
|
|
|
|
2021-11-15 19:08:06 +08:00
|
|
|
/* Define if the <stacktrace> header is supported. */
|
|
|
|
#undef HAVE_STACKTRACE
|
|
|
|
|
2011-11-07 16:46:58 +08:00
|
|
|
/* Define to 1 if you have the <stdalign.h> header file. */
|
|
|
|
#undef HAVE_STDALIGN_H
|
|
|
|
|
2006-02-27 02:42:29 +08:00
|
|
|
/* Define to 1 if you have the <stdbool.h> header file. */
|
|
|
|
#undef HAVE_STDBOOL_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <stdint.h> header file. */
|
|
|
|
#undef HAVE_STDINT_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
|
|
#undef HAVE_STDLIB_H
|
|
|
|
|
2007-05-29 01:02:30 +08:00
|
|
|
/* Define if strerror_l is available in <string.h>. */
|
|
|
|
#undef HAVE_STRERROR_L
|
|
|
|
|
|
|
|
/* Define if strerror_r is available in <string.h>. */
|
|
|
|
#undef HAVE_STRERROR_R
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <strings.h> header file. */
|
|
|
|
#undef HAVE_STRINGS_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <string.h> header file. */
|
|
|
|
#undef HAVE_STRING_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the `strtof' function. */
|
2002-02-07 01:31:43 +08:00
|
|
|
#undef HAVE_STRTOF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `strtold' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_STRTOLD
|
|
|
|
|
2015-09-23 19:26:45 +08:00
|
|
|
/* Define to 1 if `d_type' is a member of `struct dirent'. */
|
|
|
|
#undef HAVE_STRUCT_DIRENT_D_TYPE
|
|
|
|
|
2007-05-29 01:02:30 +08:00
|
|
|
/* Define if strxfrm_l is available in <string.h>. */
|
|
|
|
#undef HAVE_STRXFRM_L
|
|
|
|
|
2018-06-19 00:01:24 +08:00
|
|
|
/* Define if symlink is available in <unistd.h>. */
|
PR libstdc++/78870 support std::filesystem on Windows
PR libstdc++/78870 support std::filesystem on Windows
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check for link, readlink and symlink.
* include/bits/fs_path.h (path::operator/=(const path&)): Move
definition out of class body.
(path::is_absolute(), path::_M_append(path)): Likewise.
(operator<<(basic_ostream, const path&)): Use std::quoted directly.
(operator>>(basic_istream, path&)): Likewise.
(u8path): Reorder definitions and fix Windows implementation.
(path::is_absolute()): Define inline and fix for Windows.
[!_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::operator/=(const path&)):
Define POSIX version inline.
(path::_M_append(path)): Define inline.
* include/experimental/bits/fs_path.h (path::is_absolute()): Move
definition out of class body.
(operator<<(basic_ostream, const path&)): Fix type of delimiter and
escape characters.
(operator>>(basic_istream, path&)): Likewise.
(path::is_absolute()): Define inline and fix for Windows.
* src/filesystem/dir-common.h (__gnu_posix): New namespace.
(__gnu_posix::char_type, __gnu_posix::DIR, __gnu_posix::dirent)
(__gnu_posix::opendir, __gnu_posix::readdir, __gnu_posix::closedir):
Define as adaptors for Windows functions/types or as
using-declarations for POSIX functions/types.
(_Dir_base, get_file_type): Qualify names to use declarations from
__gnu_posix namespace.
(_Dir_base::is_dor_or_dotdot): New helper functions.
* src/filesystem/dir.cc (_Dir, recursive_directory_iterator): Qualify
names to use declarations from __gnu_posix namespace.
* src/filesystem/ops-common.h (__gnu_posix): New nested namespace.
(__gnu_posix::open, __gnu_posix::close, __gnu_posix::stat_type)
(__gnu_posix::stat, __gnu_posix::lstat, __gnu_posix::mode_t)
(__gnu_posix::chmod, __gnu_posix::mkdir, __gnu_posix::getcwd)
(__gnu_posix::chdir, __gnu_posix::utimbuf, __gnu_posix::utime)
(__gnu_posix::rename, __gnu_posix::truncate, __gnu_posix::char_type):
Define as adaptors for Windows functions/types or as
using-declarations for POSIX functions/types.
(stat_type, do_copy_file): Qualify names to use declarations from
__gnu_posix namespace.
(do_space): Declare new function.
(make_file_type): Only use S_ISLNK if defined.
* src/filesystem/ops.cc (char_ptr, filesystem::canonical): Use
path::value_type not char.
(filesystem::copy, create_dir, filesystem::create_directory): Qualify
names to use declarations from __gnu_posix namespace.
(filesystem::create_hard_link): Check HAVE_LINK autoconf macro and
add implementation for Windows.
(filesystem::create_symlink): Check HAVE_SYMLINK autoconf macro.
(filesystem::current_path(error_code&)): Use __gnu_posix::getcwd.
[!_PC_PATH_MAX]: Don't use pathconf.
[PATH_MAX]: Use if defined.
(filesystem::current_path(const path&, error_code&))
(filesystem::equivalent, do_stat, filesystem::hard_link_count)
(filesystem::last_write_time, filesystem::permissions): Use names
from __gnu_posix.
(filesystem::read_symlink): Check HAVE_READLINK autoconf macro.
(filesystem::remove) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Add
implementation for Windows.
(filesystem::rename, filesystem::resize_file): Use names from
__gnu_posix.
(filesystem::space): Use do_space.
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Get absolute path to directory.
(filesystem::status, filesystem::symlink_status): Use names from
__gnu_posix.
(filesystem::temp_directory_path): Add implementation for Windows.
* src/filesystem/path.cc (dot): Define constant.
(path::replace_extension): Use dot.
(path::_M_find_extension): Likewise. Use path::string_type not
std::string.
(path::_M_split_cmpts): Use dot.
(filesystem_error::_M_get_what): Use u8string() not native().
* src/filesystem/std-dir.cc (_Dir, recursive_directory_iterator):
Qualify names to use declarations from __gnu_posix namespace.
* src/filesystem/std-ops.cc (filesystem::absolute(const path&)): Use
correct error_code.
(filesystem::absolute(const path&, error_code&)): Add implementation
for Windows.
(char_ptr, filesystem::canonical): Use path::value_type not char.
(do_copy_file): Use names from __gnu_posix.
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Do not use fchmod, fchmodat or
sendfile.
(filesystem::copy, create_dir, filesystem::create_directory): Qualify
names to use declarations from __gnu_posix namespace.
(filesystem::create_hard_link): Check HAVE_LINK autoconf macro and
add implementation for Windows.
(filesystem::create_symlink): Check HAVE_SYMLINK autoconf macro.
(filesystem::current_path(error_code&)): Use __gnu_posix::getcwd.
[!_PC_PATH_MAX]: Don't use pathconf.
[PATH_MAX]: Use if defined.
(filesystem::current_path(const path&, error_code&))
(filesystem::equivalent, do_stat, filesystem::hard_link_count)
(filesystem::last_write_time, filesystem::permissions): Use names
from __gnu_posix.
(filesystem::read_symlink): Check HAVE_READLINK autoconf macro.
(filesystem::remove) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Add
implementation for Windows.
(filesystem::rename, filesystem::resize_file): Use names from
__gnu_posix.
(do_space): Define.
(filesystem::space): Use do_space.
(filesystem::status, filesystem::symlink_status): Use names from
__gnu_posix.
(filesystem::temp_directory_path): Add implementation for Windows.
* src/filesystem/std-path.cc
[_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::operator/=(const path&)):
Define for Windows.
(dot): Define constant.
(path::replace_extension, is_dot): Use dot.
(path::lexically_normal): Check _M_type instead of calling
non-existent function.
(path::_M_find_extension): Use dot. Use path::string_type not
std::string.
(path::_M_split_cmpts): Use dot.
(filesystem_error::_M_get_what): Use u8string() not native().
* testsuite/27_io/filesystem/iterators/directory_iterator.cc: Do not
use symlinks.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
Likewise.
* testsuite/27_io/filesystem/operations/absolute.cc: Use
__gnu_test::root_path() instead of "/" and add Windows-specific tests.
* testsuite/27_io/filesystem/operations/canonical.cc: Use
path::string() to get narrow string, not path::native().
* testsuite/27_io/filesystem/operations/copy.cc: Construct fstreams
with std::filesystem::path not std::basic_string.
* testsuite/27_io/filesystem/operations/copy_file.cc: Likewise.
* testsuite/27_io/filesystem/operations/exists.cc: Use
__gnu_test::root_path() instead of "/".
* testsuite/27_io/filesystem/operations/is_empty.cc: Construct
fstreams with std::filesystem::path not std::basic_string.
* testsuite/27_io/filesystem/operations/last_write_time.cc: Use
path::string() to get narrow string.
* testsuite/27_io/filesystem/operations/space.cc: Check results for
errors, expect sensible values otherwise.
* testsuite/27_io/filesystem/operations/temp_directory_path.cc: Add
helpers for adjusting the environment on Windows.
* testsuite/27_io/filesystem/path/append/path.cc: Test
Windows-specific behaviour.
* testsuite/27_io/filesystem/path/construct/format.cc: Fix creation
of path::string_type objects.
* testsuite/27_io/filesystem/path/construct/locale.cc: Compare native
string to wide string on Windows.
* testsuite/27_io/filesystem/path/decompose/root_directory.cc: Allow
for backslash as root-directory.
* testsuite/27_io/filesystem/path/decompose/stem.cc: Use
path::string() to get narrow string.
* testsuite/27_io/filesystem/path/itr/traversal.cc: Test Windows-style
paths.
* testsuite/27_io/filesystem/path/native/string.cc: Use string_type
not std::string.
* testsuite/27_io/filesystem/path/query/is_absolute.cc: Adjust for
different definintion of absolute paths on Windows.
* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
Do not use symlinks.
* testsuite/experimental/filesystem/operations/absolute.cc: Test
Windows behaviour.
* testsuite/experimental/filesystem/operations/copy.cc: Construct
fstreams with NTCTS not std::basic_string.
* testsuite/experimental/filesystem/operations/copy_file.cc: Likewise.
* testsuite/experimental/filesystem/operations/exists.cc: Use
__gnu_test::root_path() instead of "/".
* testsuite/experimental/filesystem/operations/is_empty.cc: Construct
fstreams with NTCTS not std::basic_string.
* testsuite/experimental/filesystem/operations/last_write_time.cc:
Use path::string() to get narrow string.
* testsuite/experimental/filesystem/operations/space.cc: Use
__gnu_test::root_path() instead of "/".
* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
Add helpers for adjusting the environment on Windows.
* testsuite/experimental/filesystem/path/append/path.cc: Use
path::string() to get narrow strings for comparisons.
* testsuite/experimental/filesystem/path/concat/path.cc: Likewise.
* testsuite/experimental/filesystem/path/decompose/root_directory.cc:
Likewise.
* testsuite/experimental/filesystem/path/decompose/stem.cc: Likewise.
* testsuite/experimental/filesystem/path/native/string.cc: Use
string_type not std::string.
* testsuite/experimental/filesystem/path/query/is_absolute.cc:
Adjust for different definintion of absolute paths on Windows.
* testsuite/util/testsuite_fs.h (__gnu_test::root_path()): New
function.
(__gnu_test::scoped_file): Construct fstreams with NTCTS not
std::basic_string.
From-SVN: r261034
2018-06-01 03:20:24 +08:00
|
|
|
#undef HAVE_SYMLINK
|
|
|
|
|
2010-07-02 20:09:29 +08:00
|
|
|
/* Define to 1 if the target runtime linker supports binding the same symbol
|
|
|
|
to different versions. */
|
|
|
|
#undef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <sys/filio.h> header file. */
|
|
|
|
#undef HAVE_SYS_FILIO_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
|
|
|
#undef HAVE_SYS_IOCTL_H
|
|
|
|
|
2005-01-04 05:31:39 +08:00
|
|
|
/* Define to 1 if you have the <sys/ipc.h> header file. */
|
|
|
|
#undef HAVE_SYS_IPC_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <sys/isa_defs.h> header file. */
|
|
|
|
#undef HAVE_SYS_ISA_DEFS_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/machine.h> header file. */
|
|
|
|
#undef HAVE_SYS_MACHINE_H
|
|
|
|
|
2022-04-13 00:56:45 +08:00
|
|
|
/* Define to 1 if you have the <sys/mman.h> header file. */
|
|
|
|
#undef HAVE_SYS_MMAN_H
|
|
|
|
|
2004-03-03 02:30:08 +08:00
|
|
|
/* Define to 1 if you have the <sys/param.h> header file. */
|
|
|
|
#undef HAVE_SYS_PARAM_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <sys/resource.h> header file. */
|
|
|
|
#undef HAVE_SYS_RESOURCE_H
|
|
|
|
|
2013-04-10 04:55:17 +08:00
|
|
|
/* Define to 1 if you have a suitable <sys/sdt.h> header file */
|
2013-03-15 16:55:07 +08:00
|
|
|
#undef HAVE_SYS_SDT_H
|
|
|
|
|
2005-01-04 05:31:39 +08:00
|
|
|
/* Define to 1 if you have the <sys/sem.h> header file. */
|
|
|
|
#undef HAVE_SYS_SEM_H
|
|
|
|
|
Use autoconf to check for features needed by Networking TS
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Check for headers used by Networking TS.
* include/experimental/executor: Include <condition_variable>
instead of <mutex>.
* include/experimental/internet: Use autoconf macros for available
headers. Include <sys/socket.h> for. Remove <cstring> and use
__builtin_memcpy and __builtin_strchr.
(resolver_errc) [!_GLIBCXX_HAVE_NETDB_H]: Do not define.
(address_v4::to_string, address_v6::to_string)
[!_GLIBCXX_HAVE_ARPA_INET_H]: Likewise.
(basic_resolver_results) [!_GLIBCXX_HAVE_NETDB_H]: Make private
constructors report errors.
[!_GLIBCXX_HAVE_NETINET_TCP_H] (tcp::no_delay): Do not define.
* include/experimental/io_context: Likewise.
* include/experimental/socket: Likewise.
[!_GLIBCXX_HAVE_SYS_SOCKET_H, !_GLIBCXX_HAVE_POLL_H] (socket_base): Do
not define nested types when relevant header not available.
(__socket_impl::native_non_blocking) [!_GLIBCXX_HAVE_FCNTL_H]: Report
an error.
(__basic_socket_impl::open, __basic_socket_impl::local_endpoint)
(__basic_socket_impl::bind) [!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(__basic_socket_impl::io_control) [!_GLIBCXX_HAVE_SYS_IOCTL_H]:
Likewise.
(basic_socket::at_mark, basic_socket::shutdown)
(basic_socket::remote_endpoint, basic_socket::connect)
(basic_socket::async_connect) [!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_socket::available) [_GLIBCXX_HAVE_SYS_IOCTL_H]: Check macro
for <sys/ioctl.h> availability.
(basic_socket::wait) [!_GLIBCXX_HAVE_POLL_H]: Likewise.
(basic_datagram_socket::receive, basic_datagram_socket::async_receive)
(basic_datagram_socket::receive_from)
(basic_datagram_socket::async_receive_from)
(basic_datagram_socket::send, basic_datagram_socket::async_send)
(basic_datagram_socket::send_to, basic_datagram_socket::async_send_to)
[!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_stream_socket::receive, basic_stream_socket::async_receive)
(basic_stream_socket::send, basic_stream_socket::async_send)
[!_GLIBCXX_HAVE_SYS_SOCKET_H]: Likewise.
(basic_socket_acceptor::listen, basic_socket_acceptor::accept)
(basic_socket_acceptor::async_accept) [!_GLIBCXX_HAVE_SYS_SOCKET_H]:
Likewise.
(basic_socket_acceptor::wait) [!_GLIBCXX_HAVE_POLL_H]: Likewise.
From-SVN: r265203
2018-10-17 00:12:32 +08:00
|
|
|
/* Define to 1 if you have the <sys/socket.h> header file. */
|
|
|
|
#undef HAVE_SYS_SOCKET_H
|
|
|
|
|
2015-05-01 03:11:52 +08:00
|
|
|
/* Define to 1 if you have the <sys/statvfs.h> header file. */
|
|
|
|
#undef HAVE_SYS_STATVFS_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
|
|
#undef HAVE_SYS_STAT_H
|
|
|
|
|
2011-05-29 01:27:01 +08:00
|
|
|
/* Define to 1 if you have the <sys/sysinfo.h> header file. */
|
|
|
|
#undef HAVE_SYS_SYSINFO_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <sys/time.h> header file. */
|
|
|
|
#undef HAVE_SYS_TIME_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
|
|
#undef HAVE_SYS_TYPES_H
|
|
|
|
|
|
|
|
/* Define to 1 if you have the <sys/uio.h> header file. */
|
|
|
|
#undef HAVE_SYS_UIO_H
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if S_IFREG is available in <sys/stat.h>. */
|
|
|
|
#undef HAVE_S_IFREG
|
|
|
|
|
2017-03-15 23:23:44 +08:00
|
|
|
/* Define if S_ISREG is available in <sys/stat.h>. */
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
#undef HAVE_S_ISREG
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `tanf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_TANF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `tanhf' function. */
|
2000-04-22 04:33:34 +08:00
|
|
|
#undef HAVE_TANHF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `tanhl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_TANHL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the `tanl' function. */
|
2000-06-07 04:26:13 +08:00
|
|
|
#undef HAVE_TANL
|
|
|
|
|
2007-03-26 18:41:41 +08:00
|
|
|
/* Define to 1 if you have the <tgmath.h> header file. */
|
|
|
|
#undef HAVE_TGMATH_H
|
|
|
|
|
2019-02-14 22:10:25 +08:00
|
|
|
/* Define to 1 if you have the `timespec_get' function. */
|
|
|
|
#undef HAVE_TIMESPEC_GET
|
|
|
|
|
2024-05-17 18:45:28 +08:00
|
|
|
/* Define to 1 if you have the <tlhelp32.h> header file. */
|
|
|
|
#undef HAVE_TLHELP32_H
|
|
|
|
|
2005-11-22 14:54:08 +08:00
|
|
|
/* Define to 1 if the target supports thread-local storage. */
|
|
|
|
#undef HAVE_TLS
|
|
|
|
|
2019-01-07 20:38:51 +08:00
|
|
|
/* Define if truncate is available in <unistd.h>. */
|
|
|
|
#undef HAVE_TRUNCATE
|
|
|
|
|
2015-09-04 19:13:34 +08:00
|
|
|
/* Define to 1 if you have the <uchar.h> header file. */
|
|
|
|
#undef HAVE_UCHAR_H
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <unistd.h> header file. */
|
|
|
|
#undef HAVE_UNISTD_H
|
|
|
|
|
libstdc++: Fix filesystem::remove_all races [PR104161]
This fixes the remaining filesystem::remove_all race condition by using
POSIX openat to recurse into sub-directories and using POSIX unlinkat to
remove files. This avoids the remaining race where the directory being
removed is replaced with a symlink after the directory has been opened,
so that the filesystem::remove("subdir/file") resolves to "target/file"
instead, because "subdir" has been removed and replaced with a symlink.
The previous patch only fixed the case where the directory was replaced
with a symlink before we tried to open it, but it still used the full
(potentially compromised) path as an argument to filesystem::remove.
The first part of the fix is to use openat when recursing into a
sub-directory with recursive_directory_iterator. This means that opening
"dir/subdir" uses the file descriptor for "dir", and so is sure to open
"dir/subdir" and not "symlink/subdir". (The previous patch to use
O_NOFOLLOW already ensured we won't open "dir/symlink/" here.)
The second part of the fix is to use unlinkat for the remove_all
operation. Previously we used a directory_iterator to get the name of
each file in a directory and then used filesystem::remove(iter->path())
on that name. This meant that any checks (e.g. O_NOFOLLOW) done by the
iterator could be invalidated before the remove operation on that
pathname. The directory iterator contains an open DIR stream, which we
can use to obtain a file descriptor to pass to unlinkat. This ensures
that the file being deleted really is contained within the directory
we're iterating over, rather than using a pathname that could resolve to
some other file.
The filesystem::remove_all function previously used a (non-recursive)
filesystem::directory_iterator for each directory, and called itself
recursively for sub-directories. The new implementation uses a single
filesystem::recursive_directory_iterator object, and calls a new __erase
member function on that iterator. That new __erase member function does
the actual work of removing a file (or a directory after its contents
have been iterated over and removed) using unlinkat. That means we don't
need to expose the DIR stream or its file descriptor to the remove_all
function, it's still encapuslated by the iterator class.
It would be possible to add a __rewind member to directory iterators
too, to call rewinddir after each modification to the directory. That
would make it more likely for filesystem::remove_all to successfully
remove everything even if files are being written to the directory tree
while removing it. It's unclear if that is actually prefereable, or if
it's better to fail and report an error at the first opportunity.
The necessary APIs (openat, unlinkat, fdopendir, dirfd) are defined in
POSIX.1-2008, and in Glibc since 2.10. But if the target doesn't provide
them, the original code (with race conditions) is still used.
This also reduces the number of small memory allocations needed for
std::filesystem::remove_all, because we do not store the full path to
every directory entry that is iterated over. The new filename_only
option means we only store the filename in the directory entry, as that
is all we need in order to use openat or unlinkat.
Finally, rather than duplicating everything for the Filesystem TS, the
std::experimental::filesystem::remove_all implementation now just calls
std::filesystem::remove_all to do the work.
libstdc++-v3/ChangeLog:
PR libstdc++/104161
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for dirfd
and unlinkat.
* config.h.in: Regenerate.
* configure: Regenerate.
* include/bits/fs_dir.h (recursive_directory_iterator): Declare
remove_all overloads as friends.
(recursive_directory_iterator::__erase): Declare new member
function.
* include/bits/fs_fwd.h (remove, remove_all): Declare.
* src/c++17/fs_dir.cc (_Dir): Add filename_only parameter to
constructor. Pass file descriptor argument to base constructor.
(_Dir::dir_and_pathname, _Dir::open_subdir, _Dir::do_unlink)
(_Dir::unlink, _Dir::rmdir): Define new member functions.
(directory_iterator): Pass filename_only argument to _Dir
constructor.
(recursive_directory_iterator::_Dir_stack): Adjust constructor
parameters to take a _Dir rvalue instead of creating one.
(_Dir_stack::orig): Add data member for storing original path.
(_Dir_stack::report_error): Define new member function.
(__directory_iterator_nofollow): Move here from dir-common.h and
fix value to be a power of two.
(__directory_iterator_filename_only): Define new constant.
(recursive_directory_iterator): Construct _Dir object and move
into _M_dirs stack. Pass skip_permission_denied argument to first
advance call.
(recursive_directory_iterator::increment): Use _Dir::open_subdir.
(recursive_directory_iterator::__erase): Define new member
function.
* src/c++17/fs_ops.cc (ErrorReporter, do_remove_all): Remove.
(fs::remove_all): Use new recursive_directory_iterator::__erase
member function.
* src/filesystem/dir-common.h (_Dir_base): Add int parameter to
constructor and use openat to implement nofollow semantics.
(_Dir_base::fdcwd, _Dir_base::set_close_on_exec, _Dir_base::openat):
Define new member functions.
(__directory_iterator_nofollow): Move to fs_dir.cc.
* src/filesystem/dir.cc (_Dir): Pass file descriptor argument to
base constructor.
(_Dir::dir_and_pathname, _Dir::open_subdir): Define new member
functions.
(recursive_directory_iterator::_Dir_stack): Adjust constructor
parameters to take a _Dir rvalue instead of creating one.
(recursive_directory_iterator): Check for new nofollow option.
Construct _Dir object and move into _M_dirs stack. Pass
skip_permission_denied argument to first advance call.
(recursive_directory_iterator::increment): Use _Dir::open_subdir.
* src/filesystem/ops.cc (fs::remove_all): Use C++17 remove_all.
2022-02-02 06:04:46 +08:00
|
|
|
/* Define if unlinkat is available in <fcntl.h>. */
|
|
|
|
#undef HAVE_UNLINKAT
|
|
|
|
|
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
|
|
|
/* Define to 1 if you have the `uselocale' function. */
|
|
|
|
#undef HAVE_USELOCALE
|
|
|
|
|
2012-11-24 06:11:23 +08:00
|
|
|
/* Defined if usleep exists. */
|
|
|
|
#undef HAVE_USLEEP
|
|
|
|
|
2015-05-02 03:48:00 +08:00
|
|
|
/* Define to 1 if you have the <utime.h> header file. */
|
|
|
|
#undef HAVE_UTIME_H
|
|
|
|
|
2005-03-24 13:45:45 +08:00
|
|
|
/* Defined if vfwscanf exists. */
|
2001-06-11 12:36:59 +08:00
|
|
|
#undef HAVE_VFWSCANF
|
|
|
|
|
2005-03-24 13:45:45 +08:00
|
|
|
/* Defined if vswscanf exists. */
|
2001-06-11 12:36:59 +08:00
|
|
|
#undef HAVE_VSWSCANF
|
|
|
|
|
2005-03-24 13:45:45 +08:00
|
|
|
/* Defined if vwscanf exists. */
|
2001-06-11 12:36:59 +08:00
|
|
|
#undef HAVE_VWSCANF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <wchar.h> header file. */
|
|
|
|
#undef HAVE_WCHAR_H
|
|
|
|
|
2005-03-24 13:45:45 +08:00
|
|
|
/* Defined if wcstof exists. */
|
2001-06-11 12:36:59 +08:00
|
|
|
#undef HAVE_WCSTOF
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to 1 if you have the <wctype.h> header file. */
|
|
|
|
#undef HAVE_WCTYPE_H
|
|
|
|
|
2022-12-13 01:27:49 +08:00
|
|
|
/* Define to 1 if you have the <windows.h> header file. */
|
|
|
|
#undef HAVE_WINDOWS_H
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if writev is available in <sys/uio.h>. */
|
|
|
|
#undef HAVE_WRITEV
|
|
|
|
|
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
|
|
|
/* Define to 1 if you have the <xlocale.h> header file. */
|
|
|
|
#undef HAVE_XLOCALE_H
|
|
|
|
|
2016-09-10 05:22:15 +08:00
|
|
|
/* Define to 1 if you have the `_aligned_malloc' function. */
|
|
|
|
#undef HAVE__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
|
|
|
/* Define to 1 if you have the `_wfopen' function. */
|
|
|
|
#undef HAVE__WFOPEN
|
|
|
|
|
2017-01-04 23:41:19 +08:00
|
|
|
/* Define to 1 if you have the `__cxa_thread_atexit' function. */
|
|
|
|
#undef HAVE___CXA_THREAD_ATEXIT
|
|
|
|
|
2013-02-26 12:39:04 +08:00
|
|
|
/* Define to 1 if you have the `__cxa_thread_atexit_impl' function. */
|
|
|
|
#undef HAVE___CXA_THREAD_ATEXIT_IMPL
|
|
|
|
|
2007-01-30 02:22:37 +08:00
|
|
|
/* Define as const if the declaration of iconv() needs const. */
|
|
|
|
#undef ICONV_CONST
|
|
|
|
|
2007-05-29 01:02:30 +08:00
|
|
|
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
|
|
|
*/
|
|
|
|
#undef LT_OBJDIR
|
|
|
|
|
2005-04-08 08:59:08 +08:00
|
|
|
/* Name of package */
|
|
|
|
#undef PACKAGE
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to the address where bug reports for this package should be sent. */
|
|
|
|
#undef PACKAGE_BUGREPORT
|
|
|
|
|
|
|
|
/* Define to the full name of this package. */
|
|
|
|
#undef PACKAGE_NAME
|
|
|
|
|
|
|
|
/* Define to the full name and version of this package. */
|
|
|
|
#undef PACKAGE_STRING
|
|
|
|
|
|
|
|
/* Define to the one symbol short name of this package. */
|
|
|
|
#undef PACKAGE_TARNAME
|
|
|
|
|
2009-08-22 21:22:20 +08:00
|
|
|
/* Define to the home page for this package. */
|
|
|
|
#undef PACKAGE_URL
|
|
|
|
|
2003-08-05 10:00:18 +08:00
|
|
|
/* Define to the version of this package. */
|
|
|
|
#undef PACKAGE_VERSION
|
|
|
|
|
|
|
|
/* Define to 1 if you have the ANSI C header files. */
|
|
|
|
#undef STDC_HEADERS
|
|
|
|
|
2005-04-08 08:59:08 +08:00
|
|
|
/* Version number of package */
|
|
|
|
#undef VERSION
|
|
|
|
|
2019-10-04 23:08:23 +08:00
|
|
|
/* Enable large inode numbers on Mac OS X 10.5. */
|
|
|
|
#ifndef _DARWIN_USE_64_BIT_INODE
|
|
|
|
# define _DARWIN_USE_64_BIT_INODE 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Number of bits in a file offset, on hosts where this is settable. */
|
|
|
|
#undef _FILE_OFFSET_BITS
|
|
|
|
|
More fine-grained autoconf checks for C99 library
2015-11-13 Jennifer Yao <jenny.hyphen.fa@gmail.com>
Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/58393
PR libstdc++/61580
* acinclude.m4 (GLIBCXX_ENABLE_C99): Perform tests twice, with
-std=c++11 as well as -std=c++98, and define separate macros for each.
Cache the results of checking for complex math and wide character
functions. Reformat for readability.
* config.h.in: Regenerate.
* include/bits/c++config: Define _GLIBCXX_USE_C99_XXX macros to
either _GLIBCXX98_USE_C99_XXX or _GLIBCXX11_USE_C99_XXX according to
language standard in use.
* config/locale/dragonfly/c_locale.h (std::__convert_from_v): Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* config/locale/generic/c_locale.h (std::__convert_from_v): Likewise.
* config/locale/gnu/c_locale.h (std::__convert_from_v): Likewise.
* config/os/bsd/dragonfly/os_defines.h: Define _GLIBCXX_USE_C99_STDIO,
_GLIBCXX_USE_C99_STDLIB, and _GLIBCXX_USE_C99_WCHAR.
* configure: Regenerate.
* include/bits/basic_string.h: Make numeric conversion functions
depend on _GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, or
_GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
* include/ext/vstring.h: Likewise.
* include/bits/locale_facets.tcc (std::num_put::_M_insert_float):
Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* include/bits/locale_facets_nonio.tcc (std::money_put::do_put):
Likewise.
* include/c_compatibility/math.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_MATH.
* include/c_compatibility/wchar.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/c_global/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/c_global/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/c_global/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/c_std/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/c_std/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/c_std/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/tr1/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/tr1/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/tr1/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/tr1/stdlib.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* src/c++98/locale_facets.cc (std::__num_base::_S_format_float):
Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* testsuite/18_support/exception_ptr/60612-terminate.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/18_support/exception_ptr/60612-unexpected.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
(test01): Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stof.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoi.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stol.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stold.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoll.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoul.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoull.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
to_wstring.cc: Likewise.
* testsuite/26_numerics/headers/cstdlib/13943.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc: Likewise.
* testsuite/lib/libstdc++.exp (check_v3_target_string_conversions):
Change preprocessor #if conditional so that it uses
_GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, and
_GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
* testsuite/tr1/8_c_compatibility/cmath/templates.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_MATH.
* testsuite/tr1/8_c_compatibility/cstdio/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc: Likewise.
* testsuite/tr1/8_c_compatibility/cwchar/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
* testsuite/util/testsuite_fs.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r230324
2015-11-13 22:51:25 +08:00
|
|
|
/* Define if C99 functions in <complex.h> should be used in <complex> for
|
|
|
|
C++11. Using compiler builtins for these functions requires corresponding
|
|
|
|
C99 library functions to be present. */
|
|
|
|
#undef _GLIBCXX11_USE_C99_COMPLEX
|
|
|
|
|
2023-05-13 07:57:15 +08:00
|
|
|
/* Define if C99 generic macros in <math.h> should be imported in <cmath> in
|
|
|
|
namespace std for C++11. */
|
More fine-grained autoconf checks for C99 library
2015-11-13 Jennifer Yao <jenny.hyphen.fa@gmail.com>
Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/58393
PR libstdc++/61580
* acinclude.m4 (GLIBCXX_ENABLE_C99): Perform tests twice, with
-std=c++11 as well as -std=c++98, and define separate macros for each.
Cache the results of checking for complex math and wide character
functions. Reformat for readability.
* config.h.in: Regenerate.
* include/bits/c++config: Define _GLIBCXX_USE_C99_XXX macros to
either _GLIBCXX98_USE_C99_XXX or _GLIBCXX11_USE_C99_XXX according to
language standard in use.
* config/locale/dragonfly/c_locale.h (std::__convert_from_v): Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* config/locale/generic/c_locale.h (std::__convert_from_v): Likewise.
* config/locale/gnu/c_locale.h (std::__convert_from_v): Likewise.
* config/os/bsd/dragonfly/os_defines.h: Define _GLIBCXX_USE_C99_STDIO,
_GLIBCXX_USE_C99_STDLIB, and _GLIBCXX_USE_C99_WCHAR.
* configure: Regenerate.
* include/bits/basic_string.h: Make numeric conversion functions
depend on _GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, or
_GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
* include/ext/vstring.h: Likewise.
* include/bits/locale_facets.tcc (std::num_put::_M_insert_float):
Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* include/bits/locale_facets_nonio.tcc (std::money_put::do_put):
Likewise.
* include/c_compatibility/math.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_MATH.
* include/c_compatibility/wchar.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/c_global/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/c_global/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/c_global/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/c_std/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/c_std/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/c_std/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/tr1/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/tr1/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/tr1/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/tr1/stdlib.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* src/c++98/locale_facets.cc (std::__num_base::_S_format_float):
Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* testsuite/18_support/exception_ptr/60612-terminate.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/18_support/exception_ptr/60612-unexpected.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
(test01): Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stof.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoi.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stol.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stold.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoll.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoul.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoull.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
to_wstring.cc: Likewise.
* testsuite/26_numerics/headers/cstdlib/13943.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc: Likewise.
* testsuite/lib/libstdc++.exp (check_v3_target_string_conversions):
Change preprocessor #if conditional so that it uses
_GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, and
_GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
* testsuite/tr1/8_c_compatibility/cmath/templates.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_MATH.
* testsuite/tr1/8_c_compatibility/cstdio/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc: Likewise.
* testsuite/tr1/8_c_compatibility/cwchar/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
* testsuite/util/testsuite_fs.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r230324
2015-11-13 22:51:25 +08:00
|
|
|
#undef _GLIBCXX11_USE_C99_MATH
|
|
|
|
|
|
|
|
/* Define if C99 functions or macros in <stdio.h> should be imported in
|
|
|
|
<cstdio> in namespace std for C++11. */
|
|
|
|
#undef _GLIBCXX11_USE_C99_STDIO
|
|
|
|
|
|
|
|
/* Define if C99 functions or macros in <stdlib.h> should be imported in
|
|
|
|
<cstdlib> in namespace std for C++11. */
|
|
|
|
#undef _GLIBCXX11_USE_C99_STDLIB
|
|
|
|
|
|
|
|
/* Define if C99 functions or macros in <wchar.h> should be imported in
|
|
|
|
<cwchar> in namespace std for C++11. */
|
|
|
|
#undef _GLIBCXX11_USE_C99_WCHAR
|
|
|
|
|
|
|
|
/* Define if C99 functions in <complex.h> should be used in <complex> for
|
|
|
|
C++98. Using compiler builtins for these functions requires corresponding
|
|
|
|
C99 library functions to be present. */
|
|
|
|
#undef _GLIBCXX98_USE_C99_COMPLEX
|
|
|
|
|
|
|
|
/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
|
|
|
|
in namespace std for C++98. */
|
|
|
|
#undef _GLIBCXX98_USE_C99_MATH
|
|
|
|
|
|
|
|
/* Define if C99 functions or macros in <stdio.h> should be imported in
|
|
|
|
<cstdio> in namespace std for C++98. */
|
|
|
|
#undef _GLIBCXX98_USE_C99_STDIO
|
|
|
|
|
2016-02-05 07:47:21 +08:00
|
|
|
/* Define if C99 functions or macros in <stdlib.h> should be imported in
|
|
|
|
<cstdlib> in namespace std for C++98. */
|
|
|
|
#undef _GLIBCXX98_USE_C99_STDLIB
|
|
|
|
|
More fine-grained autoconf checks for C99 library
2015-11-13 Jennifer Yao <jenny.hyphen.fa@gmail.com>
Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/58393
PR libstdc++/61580
* acinclude.m4 (GLIBCXX_ENABLE_C99): Perform tests twice, with
-std=c++11 as well as -std=c++98, and define separate macros for each.
Cache the results of checking for complex math and wide character
functions. Reformat for readability.
* config.h.in: Regenerate.
* include/bits/c++config: Define _GLIBCXX_USE_C99_XXX macros to
either _GLIBCXX98_USE_C99_XXX or _GLIBCXX11_USE_C99_XXX according to
language standard in use.
* config/locale/dragonfly/c_locale.h (std::__convert_from_v): Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* config/locale/generic/c_locale.h (std::__convert_from_v): Likewise.
* config/locale/gnu/c_locale.h (std::__convert_from_v): Likewise.
* config/os/bsd/dragonfly/os_defines.h: Define _GLIBCXX_USE_C99_STDIO,
_GLIBCXX_USE_C99_STDLIB, and _GLIBCXX_USE_C99_WCHAR.
* configure: Regenerate.
* include/bits/basic_string.h: Make numeric conversion functions
depend on _GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, or
_GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
* include/ext/vstring.h: Likewise.
* include/bits/locale_facets.tcc (std::num_put::_M_insert_float):
Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* include/bits/locale_facets_nonio.tcc (std::money_put::do_put):
Likewise.
* include/c_compatibility/math.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_MATH.
* include/c_compatibility/wchar.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/c_global/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/c_global/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/c_global/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/c_std/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/c_std/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/c_std/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/tr1/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/tr1/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/tr1/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/tr1/stdlib.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* src/c++98/locale_facets.cc (std::__num_base::_S_format_float):
Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* testsuite/18_support/exception_ptr/60612-terminate.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/18_support/exception_ptr/60612-unexpected.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
(test01): Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stof.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoi.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stol.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stold.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoll.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoul.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoull.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
to_wstring.cc: Likewise.
* testsuite/26_numerics/headers/cstdlib/13943.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc: Likewise.
* testsuite/lib/libstdc++.exp (check_v3_target_string_conversions):
Change preprocessor #if conditional so that it uses
_GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, and
_GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
* testsuite/tr1/8_c_compatibility/cmath/templates.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_MATH.
* testsuite/tr1/8_c_compatibility/cstdio/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc: Likewise.
* testsuite/tr1/8_c_compatibility/cwchar/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
* testsuite/util/testsuite_fs.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r230324
2015-11-13 22:51:25 +08:00
|
|
|
/* Define if C99 functions or macros in <wchar.h> should be imported in
|
|
|
|
<cwchar> in namespace std for C++98. */
|
|
|
|
#undef _GLIBCXX98_USE_C99_WCHAR
|
|
|
|
|
2011-12-01 10:20:32 +08:00
|
|
|
/* Define if the compiler supports C++11 atomics. */
|
|
|
|
#undef _GLIBCXX_ATOMIC_BUILTINS
|
2008-12-13 01:10:16 +08:00
|
|
|
|
2023-05-16 22:09:20 +08:00
|
|
|
/* Define if global objects can be aligned to
|
|
|
|
std::hardware_destructive_interference_size. */
|
|
|
|
#undef _GLIBCXX_CAN_ALIGNAS_DESTRUCTIVE_SIZE
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define to use concept checking code from the boost libraries. */
|
|
|
|
#undef _GLIBCXX_CONCEPT_CHECKS
|
|
|
|
|
2011-10-14 14:57:55 +08:00
|
|
|
/* Define to 1 if a fully dynamic basic_string is wanted, 0 to disable,
|
|
|
|
undefined for platform defaults */
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
#undef _GLIBCXX_FULLY_DYNAMIC_STRING
|
|
|
|
|
2008-08-28 18:22:19 +08:00
|
|
|
/* Define if gthreads library is available. */
|
|
|
|
#undef _GLIBCXX_HAS_GTHREADS
|
|
|
|
|
2003-09-03 02:46:54 +08:00
|
|
|
/* Define to 1 if a full hosted library is built, or 0 if freestanding. */
|
|
|
|
#undef _GLIBCXX_HOSTED
|
|
|
|
|
libstdc++: Add C++ runtime support for new 128-bit long double format
This adds support for the new __ieee128 long double format on
powerpc64le targets.
Most of the complexity comes from wanting a single libstdc++.so library
that contains the symbols needed by code compiled with both
-mabi=ibmlongdouble and -mabi=ieeelongdouble (and not forgetting
-mlong-double-64 as well!)
In a few places this just requires an extra overload, for example
std::from_chars has to be overloaded for both forms of long double.
That can be done in a single translation unit that defines overloads
for 'long double' and also '__ieee128', so that user code including
<charconv> will be able to link to a definition for either type of long
double. Those are the easy cases.
The difficult parts are (as for the std::string ABI transition) the I/O
and locale facets. In order to be able to write either form of long
double to an ostream such as std::cout we need the locale to contain a
std::num_put facet that can handle both forms. The same approach is
taken as was already done for supporting 64-bit long double and 128-bit
long double: adding extra overloads of do_put to the facet class. On
targets where the new long double code is enabled, the facets that are
registered in the locale at program startup have additional overloads so
that they can work with any long double type. Where this fails to work
is if user code installs its own facet, which will probably not have the
additional overloads and so will only be able to output one or the other
type. In practice the number of users expecting to be able to use their
own locale facets in code using a mix of -mabi=ibmlongdouble and
-mabi=ieeelongdouble is probably close to zero.
libstdc++-v3/ChangeLog:
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver: Make patterns less greedy.
* config/os/gnu-linux/ldbl-ieee128-extra.ver: New file with patterns
for IEEE128 long double symbols.
* configure: Regenerate.
* configure.ac: Enable alternative 128-bit long double format on
powerpc64*-*-linux*.
* doc/Makefile.in: Regenerate.
* fragment.am: Regenerate.
* include/Makefile.am: Set _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT.
* include/Makefile.in: Regenerate.
* include/bits/c++config: Define inline namespace for new long
double symbols. Don't define _GLIBCXX_USE_FLOAT128 when it's the
same type as long double.
* include/bits/locale_classes.h [_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT]
(locale::_Impl::_M_init_extra_ldbl128): Declare new member function.
* include/bits/locale_facets.h (_GLIBCXX_NUM_FACETS): Simplify by
only counting narrow character facets.
(_GLIBCXX_NUM_CXX11_FACETS): Likewise.
(_GLIBCXX_NUM_LBDL_ALT128_FACETS): New.
[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT] (num_get::__do_get): Define
vtable placeholder for __ibm128 long double type.
[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
(num_get::__do_get): Declare vtable placeholder for __ibm128 long
double type.
[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
(num_put::__do_put): Likewise.
* include/bits/locale_facets.tcc
[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
(num_get::__do_get, num_put::__do_put): Define.
* include/bits/locale_facets_nonio.h
[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
(money_get::__do_get): Declare vtable placeholder for __ibm128 long
double type.
[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
(money_put::__do_put): Likewise.
* include/bits/locale_facets_nonio.tcc
[_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && __LONG_DOUBLE_IEEE128__]
(money_get::__do_get, money_put::__do_put): Define.
* include/ext/numeric_traits.h [_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT]
(__numeric_traits<__ibm128>, __numeric_traits<__ieee128>): Define.
* libsupc++/Makefile.in: Regenerate.
* po/Makefile.in: Regenerate.
* python/Makefile.in: Regenerate.
* src/Makefile.am: Add compatibility-ldbl-alt128.cc and
compatibility-ldbl-alt128-cxx11.cc sources and recipes for objects.
* src/Makefile.in: Regenerate.
* src/c++11/Makefile.in: Regenerate.
* src/c++11/compatibility-ldbl-alt128-cxx11.cc: New file defining
symbols using the old 128-bit long double format, for the cxx11 ABI.
* src/c++11/compatibility-ldbl-alt128.cc: Likewise, for the
gcc4-compatible ABI.
* src/c++11/compatibility-ldbl-facets-aliases.h: New header for long
double compat aliases.
* src/c++11/cow-locale_init.cc: Add comment.
* src/c++11/cxx11-locale-inst.cc: Define C and C_is_char
unconditionally.
* src/c++11/cxx11-wlocale-inst.cc: Add sanity check. Include
locale-inst.cc directly, not via cxx11-locale-inst.cc.
* src/c++11/locale-inst-monetary.h: New header for monetary
category instantiations.
* src/c++11/locale-inst-numeric.h: New header for numeric category
instantiations.
* src/c++11/locale-inst.cc: Include new headers for monetary,
numeric, and long double definitions.
* src/c++11/wlocale-inst.cc: Remove long double compat aliases that
are defined in new header now.
* src/c++17/Makefile.am: Use -mabi=ibmlongdouble for
floating_from_chars.cc.
* src/c++17/Makefile.in: Regenerate.
* src/c++17/floating_from_chars.cc (from_chars_impl): Add
if-constexpr branch for __ieee128.
(from_chars): Overload for __ieee128.
* src/c++20/Makefile.in: Regenerate.
* src/c++98/Makefile.in: Regenerate.
* src/c++98/locale_init.cc (num_facets): Adjust calculation.
(locale::_Impl::_Impl(size_t)): Call _M_init_extra_ldbl128.
* src/c++98/localename.cc (num_facets): Adjust calculation.
(locale::_Impl::_Impl(const char*, size_t)): Call
_M_init_extra_ldbl128.
* src/filesystem/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.
* testsuite/util/testsuite_abi.cc: Add new symbol versions.
Allow new symbols to be added to GLIBCXX_IEEE128_3.4.29 and
CXXABI_IEEE128_1.3.13 too.
* testsuite/26_numerics/complex/abi_tag.cc: Add u9__ieee128 to
regex matching expected symbols.
2020-12-17 07:25:01 +08:00
|
|
|
/* Define if compatibility should be provided for alternative 128-bit long
|
|
|
|
double formats. */
|
|
|
|
#undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
|
|
|
|
|
configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check.
2006-02-07 Jakub Jelinek <jakub@redhat.com>
Benjamin Kosnik <bkoz@redhat.com>
* configure.ac (_GLIBCXX_LONG_DOUBLE_COMPAT): New check.
If true, set also port_specific_symbol_files and create
as_symver_specs.
(GLIBCXX_LDBL_COMPAT): New GLIBCXX_CONDITIONAL.
* configure: Rebuilt.
* config.h.in: Rebuilt.
* config/os/gnu-linux/ldbl-extra.ver: New file.
* config/abi/pre/gnu.ver: Make sure no __float128 symbols are
exported.
* include/bits/c++config (_GLIBCXX_LONG_DOUBLE_COMPAT,
_GLIBCXX_LDBL_NAMESPACE, _GLIBCXX_BEGIN_LDBL_NAMESPACE,
_GLIBCXX_END_LDBL_NAMESPACE): Define.
* include/bits/localefwd.h: Use them to conditionally scope facets.
* include/bits/locale_facets.h: Surround std::{money,num}_{get,put}
with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE.
Surround std::{money,num}_{get,put}
with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE.
[_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_get): Add __do_get method.
[_GLIBCXX_LONG_DOUBLE_COMPAT] (std::money_put): Add __do_put method.
[_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_get): Add __do_get method.
[_GLIBCXX_LONG_DOUBLE_COMPAT] (std::num_put): Add __do_put method.
* include/bits/locale_facets.tcc: Surround std::{money,num}_{get,put}
with _GLIBCXX_BEGIN_LDBL_NAMESPACE and _GLIBCXX_END_LDBL_NAMESPACE.
(std::money_get::__do_get, std::money_put::__do_put,
std::num_get::__do_get, std::num_put::__do_put): New
specializations.
* include/Makefile.am: Conditionally define
_GLIBCXX_LONG_DOUBLE_COMPAT in c++config.
* include/Makefile.in: Regenerate.
* src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT] (_GLIBCXX_LOC_ID,
_GLIBCXX_SYNC_ID): Define, use them.
* src/compatibility-ldbl.cc: New file.
* src/complex_io.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Add compatibility
symbols.
* src/limits.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
* src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
* src/locale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
* src/locale-misc-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
* src/istream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
* src/ostream-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
* src/locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
* src/wlocale-inst.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
* src/compatibility.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Likewise.
* config/locale/generic/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]:
Likewise.
* config/locale/gnu/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]:
Likewise.
* src/Makefile.am (libstdc++-symbol.ver): Append instead of
insert in the middle if port specific symbol file requests it.
(ldbl_compat_sources): New variable.
(sources): Use it.
(compatibility-ldbl.lo, compatibility-ldbl.o): New rules.
* src/Makefile.in: Rebuilt.
* testsuite/testsuite_abi.cc: Recognize GLIBCXX_LDBL_3.4,
GLIBCXX_LDBL_3.4.7, CXXABI_LDBL_1.3.
Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com>
From-SVN: r110725
2006-02-08 06:23:58 +08:00
|
|
|
/* Define if compatibility should be provided for -mlong-double-64. */
|
|
|
|
#undef _GLIBCXX_LONG_DOUBLE_COMPAT
|
|
|
|
|
2016-01-16 06:42:41 +08:00
|
|
|
/* Define to the letter to which size_t is mangled. */
|
|
|
|
#undef _GLIBCXX_MANGLE_SIZE_T
|
|
|
|
|
2017-01-10 01:15:58 +08:00
|
|
|
/* Define if C99 llrint and llround functions are missing from <math.h>. */
|
|
|
|
#undef _GLIBCXX_NO_C99_ROUNDING_FUNCS
|
|
|
|
|
2021-12-10 19:39:26 +08:00
|
|
|
/* Defined if no way to sleep is available. */
|
|
|
|
#undef _GLIBCXX_NO_SLEEP
|
|
|
|
|
2005-06-17 15:33:56 +08:00
|
|
|
/* Define if ptrdiff_t is int. */
|
|
|
|
#undef _GLIBCXX_PTRDIFF_T_IS_INT
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if using setrlimit to set resource limits during "make check" */
|
|
|
|
#undef _GLIBCXX_RES_LIMITS
|
|
|
|
|
2005-06-17 15:33:56 +08:00
|
|
|
/* Define if size_t is unsigned int. */
|
|
|
|
#undef _GLIBCXX_SIZE_T_IS_UINT
|
|
|
|
|
2023-01-14 21:33:58 +08:00
|
|
|
/* Define if static tzdata should be compiled into the library. */
|
|
|
|
#undef _GLIBCXX_STATIC_TZDATA
|
|
|
|
|
2010-07-27 18:36:50 +08:00
|
|
|
/* Define to the value of the EOF integer constant. */
|
|
|
|
#undef _GLIBCXX_STDIO_EOF
|
|
|
|
|
|
|
|
/* Define to the value of the SEEK_CUR integer constant. */
|
|
|
|
#undef _GLIBCXX_STDIO_SEEK_CUR
|
|
|
|
|
|
|
|
/* Define to the value of the SEEK_END integer constant. */
|
|
|
|
#undef _GLIBCXX_STDIO_SEEK_END
|
2008-08-07 07:17:05 +08:00
|
|
|
|
2005-12-18 17:39:23 +08:00
|
|
|
/* Define to use symbol versioning in the shared library. */
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
#undef _GLIBCXX_SYMVER
|
|
|
|
|
2005-12-18 17:39:23 +08:00
|
|
|
/* Define to use darwin versioning in the shared library. */
|
|
|
|
#undef _GLIBCXX_SYMVER_DARWIN
|
|
|
|
|
|
|
|
/* Define to use GNU versioning in the shared library. */
|
|
|
|
#undef _GLIBCXX_SYMVER_GNU
|
|
|
|
|
2005-12-19 08:56:05 +08:00
|
|
|
/* Define to use GNU namespace versioning in the shared library. */
|
|
|
|
#undef _GLIBCXX_SYMVER_GNU_NAMESPACE
|
|
|
|
|
2010-07-02 18:05:49 +08:00
|
|
|
/* Define to use Sun versioning in the shared library. */
|
|
|
|
#undef _GLIBCXX_SYMVER_SUN
|
|
|
|
|
2015-09-04 19:13:34 +08:00
|
|
|
/* Define if C11 functions in <uchar.h> should be imported into namespace std
|
|
|
|
in <cuchar>. */
|
|
|
|
#undef _GLIBCXX_USE_C11_UCHAR_CXX11
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if C99 functions or macros from <wchar.h>, <math.h>, <complex.h>,
|
|
|
|
<stdio.h>, and <stdlib.h> can be used or exposed. */
|
|
|
|
#undef _GLIBCXX_USE_C99
|
|
|
|
|
2023-05-12 19:44:03 +08:00
|
|
|
/* Define if C99 inverse trig functions in <complex.h> should be used in
|
|
|
|
<complex>. Using compiler builtins for these functions requires
|
|
|
|
corresponding C99 library functions to be present. */
|
|
|
|
#undef _GLIBCXX_USE_C99_COMPLEX_ARC
|
|
|
|
|
2006-01-26 03:29:40 +08:00
|
|
|
/* Define if C99 functions in <complex.h> should be used in <tr1/complex>.
|
|
|
|
Using compiler builtins for these functions requires corresponding C99
|
|
|
|
library functions to be present. */
|
|
|
|
#undef _GLIBCXX_USE_C99_COMPLEX_TR1
|
|
|
|
|
2023-05-13 04:36:56 +08:00
|
|
|
/* Define if C99 functions in <ctype.h> should be imported in <cctype> in
|
|
|
|
namespace std for C++11. */
|
|
|
|
#undef _GLIBCXX_USE_C99_CTYPE
|
|
|
|
|
2006-01-26 03:29:40 +08:00
|
|
|
/* Define if C99 functions in <ctype.h> should be imported in <tr1/cctype> in
|
|
|
|
namespace std::tr1. */
|
|
|
|
#undef _GLIBCXX_USE_C99_CTYPE_TR1
|
|
|
|
|
2023-05-13 04:36:56 +08:00
|
|
|
/* Define if C99 functions in <fenv.h> should be imported in <cfenv> in
|
|
|
|
namespace std for C++11. */
|
|
|
|
#undef _GLIBCXX_USE_C99_FENV
|
|
|
|
|
2006-01-26 19:29:20 +08:00
|
|
|
/* Define if C99 functions in <fenv.h> should be imported in <tr1/cfenv> in
|
|
|
|
namespace std::tr1. */
|
|
|
|
#undef _GLIBCXX_USE_C99_FENV_TR1
|
|
|
|
|
2023-05-13 01:53:55 +08:00
|
|
|
/* Define if C99 functions in <inttypes.h> should be imported in <cinttypes>
|
|
|
|
in namespace std in C++11. */
|
|
|
|
#undef _GLIBCXX_USE_C99_INTTYPES
|
|
|
|
|
2006-01-30 22:17:49 +08:00
|
|
|
/* Define if C99 functions in <inttypes.h> should be imported in
|
|
|
|
<tr1/cinttypes> in namespace std::tr1. */
|
|
|
|
#undef _GLIBCXX_USE_C99_INTTYPES_TR1
|
|
|
|
|
2023-05-13 01:53:55 +08:00
|
|
|
/* Define if wchar_t C99 functions in <inttypes.h> should be imported in
|
|
|
|
<cinttypes> in namespace std in C++11. */
|
|
|
|
#undef _GLIBCXX_USE_C99_INTTYPES_WCHAR_T
|
|
|
|
|
2008-09-08 00:41:06 +08:00
|
|
|
/* Define if wchar_t C99 functions in <inttypes.h> should be imported in
|
|
|
|
<tr1/cinttypes> in namespace std::tr1. */
|
|
|
|
#undef _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
|
|
|
|
|
2023-05-13 07:57:15 +08:00
|
|
|
/* Define if C99 functions in <math.h> should be imported in <cmath> in
|
|
|
|
namespace std for C++11. */
|
|
|
|
#undef _GLIBCXX_USE_C99_MATH_FUNCS
|
|
|
|
|
2006-02-07 21:14:03 +08:00
|
|
|
/* 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
|
|
|
|
|
2023-05-13 01:53:55 +08:00
|
|
|
/* Define if C99 types in <stdint.h> should be imported in <cstdint> in
|
|
|
|
namespace std for C++11. */
|
|
|
|
#undef _GLIBCXX_USE_C99_STDINT
|
|
|
|
|
2006-01-30 03:02:31 +08:00
|
|
|
/* Define if C99 types in <stdint.h> should be imported in <tr1/cstdint> in
|
|
|
|
namespace std::tr1. */
|
|
|
|
#undef _GLIBCXX_USE_C99_STDINT_TR1
|
|
|
|
|
libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd
The filesystem code was using these functions without checking for their
existence, assuming that any UNIX-like libc with <unistd.h> would always
provide them. That's not true for some newlib targets like arm-eabi.
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for mkdir,
chmod, chdir, and getcwd.
* config.h.in: Regenerate.
* configure: Regenerate.
* src/c++17/fs_ops.cc (create_dir): Use USE_MKDIR macro.
(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
(fs::permissions): Use USE_CHMOD macro.
* src/filesystem/ops-common.h [FILESYSTEM_IS_WINDOWS]
(chmod, mkdir, getcwd, chdir): Define new macros.
[FILESYSTEM_IS_WINDOWS] (chmod, mkdir, getcwd, chdir): Use
new macros.
* src/filesystem/ops.cc (create_dir): Use USE_MKDIR macro.
(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
(fs::permissions): Use USE_CHMOD macro.
2023-09-08 00:03:40 +08:00
|
|
|
/* Define if usable chdir is available in <unistd.h>. */
|
|
|
|
#undef _GLIBCXX_USE_CHDIR
|
|
|
|
|
|
|
|
/* Define if usable chmod is available in <sys/stat.h>. */
|
|
|
|
#undef _GLIBCXX_USE_CHMOD
|
|
|
|
|
Commit the vtable verification feature.
Commit the vtable verification feature. This feature is designed to
detect, at run time, if/when the vtable pointer in a C++ object has
been corrupted, before allowing virtual calls through that pointer.
If pointer corruption is detected, execution of the program is halted.
libstdc++-v3 ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* fragment.am: Add XTEMPLATE_FLAGS.
* configure.ac: Add definitions for --enable-vtable-verify.
* acinclude.m4: Add --enable-vtable-verify and
--disable-vtable-verify; define --enable-vtable-verify; define
VTV_CXXFLAGS, VTV_PCH_CXXFLAGS and VTV_CXXLINKFLAGS.
* config/abi/pre/gnu.ver: Export symbols for vtable verification.
* libsupc++/Makefile.am: Define vtv_sources and add it to
libsupc___la_SOURCES and libsupc__convenience_la_SOURCES.
* libsupc++/vtv_stubs.cc: New file.
* include/Makefile.am: Add VTV_PCH_CXXFLAGS to PCHFLAGS.
* src/Makefile.am: Add VTV_CXXFLAGS to AM_CXXFLAGS; add
VTV_CXXLINKFLAGS to CXXLINK.
* src/c++98/Makefile.am: Comment out XTEMPLATE_FLAGS; add VTV_CXXFLAGS
to AM_CXXFLAGS; add VTV_CXXXLINKFLAGS to CXXLINK.
* src/C++11/Makefile.am: Ditto.
* doc/xml/manual/configure.xml: Add entry for --enable-vtable-verify.
* scripts/testsuite_flags.in: Add cxxvtvflags to Usage; cause
cxxvtvflags to use VTV_CXXFLAGS and VTV_CXXLINKFLAGS.
* testsuite/lib/libstdc++.exp: Add cxxvtvflags; add code to locate
libvtv if --enable-vtable-verify was used; set cxxvtvflags; add
cxxvtvflags to cxx_final.
* testsuite/18_support/bad_exception/23591_thread-1.c: Add
-fvtable-verify=none to compiler flags.
* testsuite/17_intro/freestanding.cc: Add -fvtable-verify=none
to compiler flags.
* configure: Regenerated.
* Makefile.in: Regenerated.
* python/Makefile.in: Regenerated.
* include/Makefile.in: Regenerated.
* libsupc++/Makefile.in: Regenerated.
* config.h.in: Regenerated.
* po/Makefile.in: Regenerated.
* src/Makefile.in: Regenerated.
* src/c++98/Makefile.in: Regenerated.
* src/c++11/Makefile.in: Regenerated.
* doc/Makefile.in: Regenerated.
* testsuite/Makefile.in: Regenerated.
top level ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* configure.ac: Add target-libvtv to target_libraries; disable libvtv
on non-linux systems; add target-libvtv to noconfigdirs; add
libsupc++/.libs to C++ library search paths.
* configure: Regenerated.
* Makefile.def: Add libvtv to target_modules; make libvtv depend on
libstdc++ and libgcc.
* Makefile.in: Regenerated.
include/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* vtv-change-permission.h: New file.
contrib/ChangeLog:
2013-08-06 Caroline Tice4 <cmtice@google.com>
* gcc_update: Add libvtv files.
libgcc/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
config.host (extra_parts): Add vtv_start.o, vtv_end.o
vtv_start_preinit.o and vtv_end_preinit.o.
configure.ac: Add code to check/set enable_vtable_verify.
Makefile.in: Add rules to build vtv_*.o, if enable_vtable_verify is
true.
vtv_start_preinit.c: New file.
vtv_end_preinit.c: New file.
vtv_start.c: New file.
vtv_end.c: New file.
configure: Regenerated.
gcc/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* gcc.c (VTABLE_VERIFICATION_SPEC): New definition.
(LINK_COMMAND_SPEC): Add VTABLE_VERIFICATION_SPEC.
* tree-pass.h: Add pass_vtable_verify.
* varasm.c (assemble_variable): Add code to properly set the comdat
section and name for the .vtable_map_vars section.
(assemble_vtyv_preinit_initializer): New function.
(default_sectin_type_flags): Make sure .vtable_map_vars section has
LINK_ONCE flag.
* output.h: Add function decl for assemble_vtv_preinit_initializer.
* vtable-verify.c: New file.
* vtable-verify.h: New file.
* flag-types.h (enum vtv_priority): Defintions for flag_vtable_verify
initialiation levels.
* timevar.def (TV_VTABLE_VERIFICATION): New definition.
* passes.def: Insert pass_vtable_verify.
* aclocal.m4: Reorder includes.
* doc/invoke.texi: Add documentation for the flags -fvtable-verify=,
-fvtv-debug and -fvtv-counts.
* config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Add vtv_start*.o,
as appropriate, if -fvtable-verify=... is used.
(GNU_USER_TARGET_ENDFILE_SPEC): Add vtv_end*.o as appropriate, if
-fvtable-verify=... is used.
* Makefile.in (OBJS): Add vtable-verify.o to list.
(vtable-verify.o): Add new build rule.
(GTFILES): Add vtable-verify.c to list.
* common.opt (fvtable-verify=): New flag.
(vtv_priority): Values for fvtable-verify= flag.
(fvtv-counts): New flag.
(fvtv-debug): New flag.
* tree.h (save_vtable_map_decl): New extern function decl.
gcc/cp/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
list.
(vtable-class-hierarchy.o): Add build rule.
* cp-tree.h (vtv_start_verification_constructor_init_function): New
extern function decl.
(vtv_finish_verification_constructor_init_function): New extern
function decl.
(build_vtbl_address): New extern function decl.
(get_mangled_vtable_map_var_name): New extern function decl.
(vtv_compute_class_hierarchy_transitive_closure): New extern function
decl.
(vtv_generate_init_routine): New extern function decl.
(vtv_save_class_info): New extern function decl.
(vtv_recover_class_info): New extern function decl.
(vtv_build_vtable_verify_fndecl): New extern function decl.
* class.c (finish_struct_1): Add call to vtv_save_class_info if
flag_vtable_verify is true.
* config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
* vtable-class-hierarchy.c: New file.
* mangle.c (get_mangled_vtable_map_var_name): New function.
* decl2.c (start_objects): Update function comment.
(cp_write_global_declarations): Call vtv_recover_class_info,
vtv_compute_class_hierarchy_transitive_closure and
vtv_build_vtable_verify_fndecl, before calling
finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
flag_vtable_verify is true.
(vtv_start_verification_constructor_init_function): New function.
(vtv_finish_verification_constructor_init_function): New function.
* init.c (build_vtbl_address): Remove static qualifier from function.
libvtv/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
Initial check-in of new vtable verification feature.
* configure.ac : New file.
* acinclude.m4 : New file.
* Makefile.am : New file.
* aclocal.m4 : New file.
* configure.tgt : New file.
* configure: New file (generated).
* Makefile.in: New file (generated).
* vtv_set.h : New file.
* vtv_utils.cc : New file.
* vtv_utils.h : New file.
* vtv_malloc.cc : New file.
* vtv_rts.cc : New file.
* vtv_malloc.h : New file.
* vtv_rts.h : New file.
* vtv_fail.cc : New file.
* vtv_fail.h : New file.
* vtv_map.h : New file.
* scripts/run-testsuite.sh : New file.
* scripts/sum-vtv-counts.c : New file.
* testsuite/parts-test-main.h : New file.
* testusite/dataentry.cc : New file.
* testsuite/temp_deriv.cc : New file.
* testsuite/register_pair.cc : New file.
* testsuite/virtual_inheritance.cc : New file.
* testsuite/field-test.cc : New file.
* testsuite/nested_vcall_test.cc : New file.
* testsuite/template-list-iostream.cc : New file.
* testsuite/register_pair_inserts.cc : New file.
* testsuite/register_pair_inserts_mt.cc : New file.
* testsuite/event.list : New file.
* testsuite/parts-test-extra-parts-views.cc : New file.
* testsuite/parts-test-extra-parts-views.h : New file.
* testsuite/environment-fail-32.s : New file.
* testsuite/parts-test-extra-parts.h : New file.
* testsuite/temp_deriv2.cc : New file.
* testsuite/dlopen_mt.cc : New file.
* testsuite/event.h : New file.
* testsuite/template-list.cc : New file.
* testsuite/replace-fail.cc : New file.
* testsuite/Makefile.am : New file.
* testsuite/Makefile.in: New file (generated).
* testsuite/mempool_negative.c : New file.
* testsuite/parts-test-main.cc : New file.
* testsuite/event-private.cc : New file.
* testsuite/thunk.cc : New file.
* testsuite/event-defintiions.cc : New file.
* testsuite/event-private.h : New file.
* testsuite/parts-test.list : New file.
* testusite/register_pair_mt.cc : New file.
* testsuite/povray-derived.cc : New file.
* testsuite/event-main.cc : New file.
* testsuite/environment.cc : New file.
* testsuite/template-list2.cc : New file.
* testsuite/thunk_vtable_map_attack.cc : New file.
* testsuite/parts-test-extra-parts.cc : New file.
* testsuite/environment-fail-64.s : New file.
* testsuite/dlopen.cc : New file.
* testsuite/so.cc : New file.
* testsuite/temp_deriv3.cc : New file.
* testsuite/const_vtable.cc : New file.
* testsuite/mempool_positive.c : New file.
* testsuite/dup_name.cc : New file.
From-SVN: r201555
2013-08-07 11:38:59 +08:00
|
|
|
/* Defined if clock_gettime syscall has monotonic and realtime clock support.
|
|
|
|
*/
|
|
|
|
#undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
|
|
|
|
|
2008-07-16 07:23:23 +08:00
|
|
|
/* Defined if clock_gettime has monotonic clock support. */
|
|
|
|
#undef _GLIBCXX_USE_CLOCK_MONOTONIC
|
|
|
|
|
|
|
|
/* Defined if clock_gettime has realtime clock support. */
|
|
|
|
#undef _GLIBCXX_USE_CLOCK_REALTIME
|
|
|
|
|
2023-03-09 02:37:43 +08:00
|
|
|
/* Define if copy_file_range is available in <unistd.h>. */
|
|
|
|
#undef _GLIBCXX_USE_COPY_FILE_RANGE
|
|
|
|
|
2009-10-06 01:42:00 +08:00
|
|
|
/* Define if ISO/IEC TR 24733 decimal floating point types are supported on
|
|
|
|
this host. */
|
|
|
|
#undef _GLIBCXX_USE_DECIMAL_FLOAT
|
|
|
|
|
2018-10-16 22:49:29 +08:00
|
|
|
/* Define if /dev/random and /dev/urandom are available for
|
|
|
|
std::random_device. */
|
|
|
|
#undef _GLIBCXX_USE_DEV_RANDOM
|
|
|
|
|
2015-05-14 21:23:14 +08:00
|
|
|
/* Define if fchmod is available in <sys/stat.h>. */
|
|
|
|
#undef _GLIBCXX_USE_FCHMOD
|
|
|
|
|
2015-05-02 03:48:00 +08:00
|
|
|
/* Define if fchmodat is available in <sys/stat.h>. */
|
|
|
|
#undef _GLIBCXX_USE_FCHMODAT
|
|
|
|
|
2023-07-07 00:10:41 +08:00
|
|
|
/* Define if fseeko and ftello are available. */
|
|
|
|
#undef _GLIBCXX_USE_FSEEKO_FTELLO
|
|
|
|
|
libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd
The filesystem code was using these functions without checking for their
existence, assuming that any UNIX-like libc with <unistd.h> would always
provide them. That's not true for some newlib targets like arm-eabi.
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for mkdir,
chmod, chdir, and getcwd.
* config.h.in: Regenerate.
* configure: Regenerate.
* src/c++17/fs_ops.cc (create_dir): Use USE_MKDIR macro.
(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
(fs::permissions): Use USE_CHMOD macro.
* src/filesystem/ops-common.h [FILESYSTEM_IS_WINDOWS]
(chmod, mkdir, getcwd, chdir): Define new macros.
[FILESYSTEM_IS_WINDOWS] (chmod, mkdir, getcwd, chdir): Use
new macros.
* src/filesystem/ops.cc (create_dir): Use USE_MKDIR macro.
(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
(fs::permissions): Use USE_CHMOD macro.
2023-09-08 00:03:40 +08:00
|
|
|
/* Define if usable getcwd is available in <unistd.h>. */
|
|
|
|
#undef _GLIBCXX_USE_GETCWD
|
|
|
|
|
2008-07-16 07:23:23 +08:00
|
|
|
/* Defined if gettimeofday is available. */
|
|
|
|
#undef _GLIBCXX_USE_GETTIMEOFDAY
|
|
|
|
|
2011-05-29 01:27:01 +08:00
|
|
|
/* Define if get_nprocs is available in <sys/sysinfo.h>. */
|
|
|
|
#undef _GLIBCXX_USE_GET_NPROCS
|
|
|
|
|
2023-06-30 18:07:35 +08:00
|
|
|
/* Define if init_priority should be used for iostream initialization. */
|
|
|
|
#undef _GLIBCXX_USE_INIT_PRIORITY_ATTRIBUTE
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if LFS support is available. */
|
|
|
|
#undef _GLIBCXX_USE_LFS
|
|
|
|
|
|
|
|
/* Define if code specialized for long long should be used. */
|
|
|
|
#undef _GLIBCXX_USE_LONG_LONG
|
|
|
|
|
PR libstdc++/86756 Move rest of std::filesystem to libstdc++.so
Move std::filesystem directory iterators and operations from
libstdc++fs.a to main libstdc++ library. These components have many
dependencies on OS support, which is not available on all targets. Some
additional autoconf checks and conditional compilation is needed to
ensure the files will build for all targets. Previously this code was
not compiled without --enable-libstdcxx-filesystem-ts but the C++17
components should be available for all hosted builds.
The tests for these components no longer need to link to libstdc++fs.a,
but are not expected to pass on all targets. To avoid numerous failures
on targets which are not expected to pass the tests (due to missing OS
functionality) leave the dg-require-filesystem-ts directives in place
for now. This will ensure the tests only run for builds where the
filesystem-ts library is built, which presumably means some level of OS
support is present.
PR libstdc++/86756
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for utime and
lstat and define _GLIBCXX_USE_UTIME and _GLIBCXX_USE_LSTAT.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export symbols for
remaining std::filesystem types and functions.
* configure: Regenerate.
* src/c++17/Makefile.am: Add C++17 filesystem sources.
* src/c++17/Makefile.in: Regenerate.
* src/c++17/cow-fs_dir.cc: Move src/filesystem/cow-std-dir.cc to
here, and change name of included file.
* src/c++17/cow-fs_ops.cc: Move src/filesystem/cow-std-ops.cc to
here, and change name of included file.
* src/c++17/fs_dir.cc: Move src/filesystem/std-dir.cc to here. Change
path to dir-common.h.
* src/c++17/fs_ops.cc: Move src/filesystem/std-ops.cc to here. Change
path to ops-common.h. Disable -Wunused-parameter warnings.
(internal_file_clock): Define unconditionally.
[!_GLIBCXX_HAVE_SYS_STAT_H] (internal_file_clock::from_stat): Do not
define.
(do_copy_file, do_space): Move definitions to ops.common.h.
(copy, file_size, hard_link_count, last_write_time, space): Only
perform operation when _GLIBCXX_HAVE_SYS_STAT_H is defined, otherwise
report an error.
(last_write_time, read_symlink): Remove unused attributes from
parameters.
* src/filesystem/Makefile.am: Remove C++17 filesystem sources.
* src/filesystem/Makefile.in: Regenerate.
* src/filesystem/cow-std-dir.cc: Move to src/c++17/cow-fs_dir.cc.
* src/filesystem/cow-std-ops.cc: Move to src/c++17/cow-fs_ops.cc.
* src/filesystem/std-dir.cc: Move to src/c++17/fs_dir.cc.
* src/filesystem/std-ops.cc: Move to src/c++17/fs_ops.cc.
* src/filesystem/dir-common.h [!_GLIBCXX_HAVE_DIRENT_H]: Define
dummy types and functions instead of using #error.
* src/filesystem/dir.cc [!_GLIBCXX_HAVE_DIRENT_H]: Use #error.
* src/filesystem/ops-common.h [!_GLIBCXX_USE_LSTAT] (lstat): Define
in terms of stat.
[!_GLIBCXX_HAVE_UNISTD_H]: Define dummy types and functions.
(do_copy_file, do_space): Move definitions here from std-ops.cc.
* src/filesystem/ops.cc: Adjust calls to do_copy_file and do_space
to account for new namespace.
* testsuite/27_io/filesystem/directory_entry/86597.cc: Remove
-lstdc++fs from dg-options.
* testsuite/27_io/filesystem/directory_entry/lwg3171.cc: Likewise.
* testsuite/27_io/filesystem/file_status/1.cc: Likewise.
* testsuite/27_io/filesystem/filesystem_error/cons.cc: Likewise.
* testsuite/27_io/filesystem/filesystem_error/copy.cc: Likewise.
* testsuite/27_io/filesystem/iterators/directory_iterator.cc:
Likewise.
* testsuite/27_io/filesystem/iterators/pop.cc: Likewise.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
Likewise.
* testsuite/27_io/filesystem/operations/absolute.cc: Likewise.
* testsuite/27_io/filesystem/operations/canonical.cc: Likewise.
* testsuite/27_io/filesystem/operations/copy.cc: Likewise.
* testsuite/27_io/filesystem/operations/copy_file.cc: Likewise.
* testsuite/27_io/filesystem/operations/create_directories.cc:
Likewise.
* testsuite/27_io/filesystem/operations/create_directory.cc: Likewise.
* testsuite/27_io/filesystem/operations/create_symlink.cc: Likewise.
* testsuite/27_io/filesystem/operations/current_path.cc: Likewise.
* testsuite/27_io/filesystem/operations/equivalent.cc: Likewise.
* testsuite/27_io/filesystem/operations/exists.cc: Likewise.
* testsuite/27_io/filesystem/operations/file_size.cc: Likewise.
* testsuite/27_io/filesystem/operations/is_empty.cc: Likewise.
* testsuite/27_io/filesystem/operations/last_write_time.cc: Likewise.
* testsuite/27_io/filesystem/operations/permissions.cc: Likewise.
* testsuite/27_io/filesystem/operations/proximate.cc: Likewise.
* testsuite/27_io/filesystem/operations/read_symlink.cc: Likewise.
* testsuite/27_io/filesystem/operations/relative.cc: Likewise.
* testsuite/27_io/filesystem/operations/remove.cc: Likewise.
* testsuite/27_io/filesystem/operations/remove_all.cc: Likewise.
* testsuite/27_io/filesystem/operations/space.cc: Likewise.
* testsuite/27_io/filesystem/operations/status.cc: Likewise.
* testsuite/27_io/filesystem/operations/symlink_status.cc: Likewise.
* testsuite/27_io/filesystem/operations/temp_directory_path.cc:
Likewise.
* testsuite/27_io/filesystem/operations/weakly_canonical.cc: Likewise.
From-SVN: r267616
2019-01-07 06:34:37 +08:00
|
|
|
/* Define if lstat is available in <sys/stat.h>. */
|
|
|
|
#undef _GLIBCXX_USE_LSTAT
|
|
|
|
|
libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd
The filesystem code was using these functions without checking for their
existence, assuming that any UNIX-like libc with <unistd.h> would always
provide them. That's not true for some newlib targets like arm-eabi.
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for mkdir,
chmod, chdir, and getcwd.
* config.h.in: Regenerate.
* configure: Regenerate.
* src/c++17/fs_ops.cc (create_dir): Use USE_MKDIR macro.
(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
(fs::permissions): Use USE_CHMOD macro.
* src/filesystem/ops-common.h [FILESYSTEM_IS_WINDOWS]
(chmod, mkdir, getcwd, chdir): Define new macros.
[FILESYSTEM_IS_WINDOWS] (chmod, mkdir, getcwd, chdir): Use
new macros.
* src/filesystem/ops.cc (create_dir): Use USE_MKDIR macro.
(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
(fs::permissions): Use USE_CHMOD macro.
2023-09-08 00:03:40 +08:00
|
|
|
/* Define if usable mkdir is available in <sys/stat.h>. */
|
|
|
|
#undef _GLIBCXX_USE_MKDIR
|
|
|
|
|
2008-09-13 08:32:37 +08:00
|
|
|
/* Defined if nanosleep is available. */
|
|
|
|
#undef _GLIBCXX_USE_NANOSLEEP
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if NLS translations are to be used. */
|
|
|
|
#undef _GLIBCXX_USE_NLS
|
|
|
|
|
libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318]
This is another C++26 change, approved in Varna 2023. We require a new
static array of data that is extracted from the IANA Character Sets
database. A new Python script to generate a header from the IANA CSV
file is added.
The text_encoding class is basically just a pointer to an {ID,name} pair
in the static array. The aliases view is also just the same pointer (or
empty), and the view's iterator moves forwards and backwards in the
array while the array elements have the same ID (or to one element
further, for a past-the-end iterator).
Because those iterators refer to a global array that never goes out of
scope, there's no reason they should every produce undefined behaviour
or indeterminate values. They should either have well-defined
behaviour, or abort. The overhead of ensuring those properties is pretty
low, so seems worth it.
This means that an aliases_view iterator should never be able to access
out-of-bounds. A non-value-initialized iterator always points to an
element of the static array even when not dereferenceable (the array has
unreachable entries at the start and end, which means that even a
past-the-end iterator for the last encoding in the array still points to
valid memory). Dereferencing an iterator can always return a valid
array element, or "" for a non-dereferenceable iterator (but doing so
will abort when assertions are enabled). In the language being proposed
for C++26, dereferencing an invalid iterator erroneously returns "".
Attempting to increment/decrement past the last/first element in the
view is erroneously a no-op, so aborts when assertions are enabled, and
doesn't change value otherwise.
Similarly, constructing a std::text_encoding with an invalid id (one
that doesn't have the value of an enumerator) erroneously behaves the
same as constructing with id::unknown, or aborts with assertions
enabled.
libstdc++-v3/ChangeLog:
PR libstdc++/113318
* acinclude.m4 (GLIBCXX_CONFIGURE): Add c++26 directory.
(GLIBCXX_CHECK_TEXT_ENCODING): Define.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Use GLIBCXX_CHECK_TEXT_ENCODING.
* include/Makefile.am: Add new headers.
* include/Makefile.in: Regenerate.
* include/bits/locale_classes.h (locale::encoding): Declare new
member function.
* include/bits/unicode.h (__charset_alias_match): New function.
* include/bits/text_encoding-data.h: New file.
* include/bits/version.def (text_encoding): Define.
* include/bits/version.h: Regenerate.
* include/std/text_encoding: New file.
* src/Makefile.am: Add new subdirectory.
* src/Makefile.in: Regenerate.
* src/c++26/Makefile.am: New file.
* src/c++26/Makefile.in: New file.
* src/c++26/text_encoding.cc: New file.
* src/experimental/Makefile.am: Include c++26 convenience
library.
* src/experimental/Makefile.in: Regenerate.
* python/libstdcxx/v6/printers.py (StdTextEncodingPrinter): New
printer.
* scripts/gen_text_encoding_data.py: New file.
* testsuite/22_locale/locale/encoding.cc: New test.
* testsuite/ext/unicode/charset_alias_match.cc: New test.
* testsuite/std/text_encoding/cons.cc: New test.
* testsuite/std/text_encoding/members.cc: New test.
* testsuite/std/text_encoding/requirements.cc: New test.
Reviewed-by: Ulrich Drepper <drepper.fsp@gmail.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
2024-01-15 23:42:50 +08:00
|
|
|
/* Define if nl_langinfo_l should be used for std::text_encoding. */
|
|
|
|
#undef _GLIBCXX_USE_NL_LANGINFO_L
|
|
|
|
|
2011-11-07 21:45:03 +08:00
|
|
|
/* Define if pthreads_num_processors_np is available in <pthread.h>. */
|
|
|
|
#undef _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP
|
|
|
|
|
2019-09-05 06:43:29 +08:00
|
|
|
/* Define if pthread_cond_clockwait is available in <pthread.h>. */
|
|
|
|
#undef _GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT
|
|
|
|
|
2019-12-03 00:23:01 +08:00
|
|
|
/* Define if pthread_mutex_clocklock is available in <pthread.h>. */
|
|
|
|
#undef _GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK
|
|
|
|
|
2019-12-03 00:23:10 +08:00
|
|
|
/* Define if pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock are
|
|
|
|
available in <pthread.h>. */
|
|
|
|
#undef _GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK
|
|
|
|
|
2015-03-18 18:53:38 +08:00
|
|
|
/* Define if POSIX read/write locks are available in <gthr.h>. */
|
|
|
|
#undef _GLIBCXX_USE_PTHREAD_RWLOCK_T
|
|
|
|
|
2008-08-25 07:47:35 +08:00
|
|
|
/* Define if /dev/random and /dev/urandom are available for the random_device
|
|
|
|
of TR1 (Chapter 5.1). */
|
2006-06-10 07:37:28 +08:00
|
|
|
#undef _GLIBCXX_USE_RANDOM_TR1
|
|
|
|
|
2015-09-17 06:50:28 +08:00
|
|
|
/* Define if usable realpath is available in <stdlib.h>. */
|
2015-05-01 03:11:52 +08:00
|
|
|
#undef _GLIBCXX_USE_REALPATH
|
|
|
|
|
2009-01-15 22:01:04 +08:00
|
|
|
/* Defined if sched_yield is available. */
|
|
|
|
#undef _GLIBCXX_USE_SCHED_YIELD
|
|
|
|
|
2011-05-29 01:27:01 +08:00
|
|
|
/* Define if _SC_NPROCESSORS_ONLN is available in <unistd.h>. */
|
|
|
|
#undef _GLIBCXX_USE_SC_NPROCESSORS_ONLN
|
|
|
|
|
2011-11-07 21:45:03 +08:00
|
|
|
/* Define if _SC_NPROC_ONLN is available in <unistd.h>. */
|
|
|
|
#undef _GLIBCXX_USE_SC_NPROC_ONLN
|
|
|
|
|
2016-05-26 00:13:52 +08:00
|
|
|
/* Define if sendfile is available in <sys/sendfile.h>. */
|
2015-05-14 21:23:14 +08:00
|
|
|
#undef _GLIBCXX_USE_SENDFILE
|
|
|
|
|
2020-12-16 01:39:24 +08:00
|
|
|
/* Define to restrict std::__basic_file<> to stdio APIs. */
|
|
|
|
#undef _GLIBCXX_USE_STDIO_PURE
|
|
|
|
|
2015-05-01 03:11:52 +08:00
|
|
|
/* Define if struct stat has timespec members. */
|
|
|
|
#undef _GLIBCXX_USE_ST_MTIM
|
|
|
|
|
2011-11-07 21:45:03 +08:00
|
|
|
/* Define if sysctl(), CTL_HW and HW_NCPU are available in <sys/sysctl.h>. */
|
|
|
|
#undef _GLIBCXX_USE_SYSCTL_HW_NCPU
|
|
|
|
|
2014-01-24 05:17:15 +08:00
|
|
|
/* Define if obsolescent tmpnam is available in <stdio.h>. */
|
|
|
|
#undef _GLIBCXX_USE_TMPNAM
|
|
|
|
|
2022-01-17 22:56:33 +08:00
|
|
|
/* Define if c8rtomb and mbrtoc8 functions in <uchar.h> should be imported
|
|
|
|
into namespace std in <cuchar> for C++20. */
|
|
|
|
#undef _GLIBCXX_USE_UCHAR_C8RTOMB_MBRTOC8_CXX20
|
|
|
|
|
|
|
|
/* Define if c8rtomb and mbrtoc8 functions in <uchar.h> should be imported
|
|
|
|
into namespace std in <cuchar> for -fchar8_t. */
|
|
|
|
#undef _GLIBCXX_USE_UCHAR_C8RTOMB_MBRTOC8_FCHAR8_T
|
|
|
|
|
PR libstdc++/86756 Move rest of std::filesystem to libstdc++.so
Move std::filesystem directory iterators and operations from
libstdc++fs.a to main libstdc++ library. These components have many
dependencies on OS support, which is not available on all targets. Some
additional autoconf checks and conditional compilation is needed to
ensure the files will build for all targets. Previously this code was
not compiled without --enable-libstdcxx-filesystem-ts but the C++17
components should be available for all hosted builds.
The tests for these components no longer need to link to libstdc++fs.a,
but are not expected to pass on all targets. To avoid numerous failures
on targets which are not expected to pass the tests (due to missing OS
functionality) leave the dg-require-filesystem-ts directives in place
for now. This will ensure the tests only run for builds where the
filesystem-ts library is built, which presumably means some level of OS
support is present.
PR libstdc++/86756
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for utime and
lstat and define _GLIBCXX_USE_UTIME and _GLIBCXX_USE_LSTAT.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export symbols for
remaining std::filesystem types and functions.
* configure: Regenerate.
* src/c++17/Makefile.am: Add C++17 filesystem sources.
* src/c++17/Makefile.in: Regenerate.
* src/c++17/cow-fs_dir.cc: Move src/filesystem/cow-std-dir.cc to
here, and change name of included file.
* src/c++17/cow-fs_ops.cc: Move src/filesystem/cow-std-ops.cc to
here, and change name of included file.
* src/c++17/fs_dir.cc: Move src/filesystem/std-dir.cc to here. Change
path to dir-common.h.
* src/c++17/fs_ops.cc: Move src/filesystem/std-ops.cc to here. Change
path to ops-common.h. Disable -Wunused-parameter warnings.
(internal_file_clock): Define unconditionally.
[!_GLIBCXX_HAVE_SYS_STAT_H] (internal_file_clock::from_stat): Do not
define.
(do_copy_file, do_space): Move definitions to ops.common.h.
(copy, file_size, hard_link_count, last_write_time, space): Only
perform operation when _GLIBCXX_HAVE_SYS_STAT_H is defined, otherwise
report an error.
(last_write_time, read_symlink): Remove unused attributes from
parameters.
* src/filesystem/Makefile.am: Remove C++17 filesystem sources.
* src/filesystem/Makefile.in: Regenerate.
* src/filesystem/cow-std-dir.cc: Move to src/c++17/cow-fs_dir.cc.
* src/filesystem/cow-std-ops.cc: Move to src/c++17/cow-fs_ops.cc.
* src/filesystem/std-dir.cc: Move to src/c++17/fs_dir.cc.
* src/filesystem/std-ops.cc: Move to src/c++17/fs_ops.cc.
* src/filesystem/dir-common.h [!_GLIBCXX_HAVE_DIRENT_H]: Define
dummy types and functions instead of using #error.
* src/filesystem/dir.cc [!_GLIBCXX_HAVE_DIRENT_H]: Use #error.
* src/filesystem/ops-common.h [!_GLIBCXX_USE_LSTAT] (lstat): Define
in terms of stat.
[!_GLIBCXX_HAVE_UNISTD_H]: Define dummy types and functions.
(do_copy_file, do_space): Move definitions here from std-ops.cc.
* src/filesystem/ops.cc: Adjust calls to do_copy_file and do_space
to account for new namespace.
* testsuite/27_io/filesystem/directory_entry/86597.cc: Remove
-lstdc++fs from dg-options.
* testsuite/27_io/filesystem/directory_entry/lwg3171.cc: Likewise.
* testsuite/27_io/filesystem/file_status/1.cc: Likewise.
* testsuite/27_io/filesystem/filesystem_error/cons.cc: Likewise.
* testsuite/27_io/filesystem/filesystem_error/copy.cc: Likewise.
* testsuite/27_io/filesystem/iterators/directory_iterator.cc:
Likewise.
* testsuite/27_io/filesystem/iterators/pop.cc: Likewise.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
Likewise.
* testsuite/27_io/filesystem/operations/absolute.cc: Likewise.
* testsuite/27_io/filesystem/operations/canonical.cc: Likewise.
* testsuite/27_io/filesystem/operations/copy.cc: Likewise.
* testsuite/27_io/filesystem/operations/copy_file.cc: Likewise.
* testsuite/27_io/filesystem/operations/create_directories.cc:
Likewise.
* testsuite/27_io/filesystem/operations/create_directory.cc: Likewise.
* testsuite/27_io/filesystem/operations/create_symlink.cc: Likewise.
* testsuite/27_io/filesystem/operations/current_path.cc: Likewise.
* testsuite/27_io/filesystem/operations/equivalent.cc: Likewise.
* testsuite/27_io/filesystem/operations/exists.cc: Likewise.
* testsuite/27_io/filesystem/operations/file_size.cc: Likewise.
* testsuite/27_io/filesystem/operations/is_empty.cc: Likewise.
* testsuite/27_io/filesystem/operations/last_write_time.cc: Likewise.
* testsuite/27_io/filesystem/operations/permissions.cc: Likewise.
* testsuite/27_io/filesystem/operations/proximate.cc: Likewise.
* testsuite/27_io/filesystem/operations/read_symlink.cc: Likewise.
* testsuite/27_io/filesystem/operations/relative.cc: Likewise.
* testsuite/27_io/filesystem/operations/remove.cc: Likewise.
* testsuite/27_io/filesystem/operations/remove_all.cc: Likewise.
* testsuite/27_io/filesystem/operations/space.cc: Likewise.
* testsuite/27_io/filesystem/operations/status.cc: Likewise.
* testsuite/27_io/filesystem/operations/symlink_status.cc: Likewise.
* testsuite/27_io/filesystem/operations/temp_directory_path.cc:
Likewise.
* testsuite/27_io/filesystem/operations/weakly_canonical.cc: Likewise.
From-SVN: r267616
2019-01-07 06:34:37 +08:00
|
|
|
/* Define if utime is available in <utime.h>. */
|
|
|
|
#undef _GLIBCXX_USE_UTIME
|
|
|
|
|
2015-05-01 03:11:52 +08:00
|
|
|
/* Define if utimensat and UTIME_OMIT are available in <sys/stat.h> and
|
|
|
|
AT_FDCWD in <fcntl.h>. */
|
|
|
|
#undef _GLIBCXX_USE_UTIMENSAT
|
|
|
|
|
acinclude.m4 (_GLIBCXX_USE_LONG_LONG, [...]): Use long form of AC_DEFINE ...
2005-04-06 Kelley Cook <kcook@gcc.gnu.org>
* acinclude.m4 (_GLIBCXX_USE_LONG_LONG,
_GLIBCXX_USE_WCHAR_T, _GLIBCXX_USE_C99, _GLIBCXX_USE_C99_MATH,
_GLIBCXX_USE_C99_COMPLEX, _GLIBCXX_RES_LIMITS, _GLIBCXX_CONCEPT_CHECKS,
_GLIBCXX_SYMVER, _GLIBCXX_USE_LFS, _GLIBCXX_FULLY_DYNAMIC_STRING,
_GLIBCXX_USE_NLS, HAVE_GTHR_DEFAULT, HAVE_MBSTATE_T, HAVE_POLL,
HAVE_S_ISREG, HAVE_S_IFREG, HAVE_WRITEV, HAVE_INT64_T,
HAVE_LC_MESSAGES): Use long form of AC_DEFINE ...
* acconfig.h: ... to eliminate them from here.
(_GLIBCXX_ASM_SYMVER): Move definition below @BOTTOM@.
* config.h.in, configure: Regenerate.
From-SVN: r97685
2005-04-06 09:32:03 +08:00
|
|
|
/* Define if code specialized for wchar_t should be used. */
|
|
|
|
#undef _GLIBCXX_USE_WCHAR_T
|
|
|
|
|
2022-12-24 07:45:15 +08:00
|
|
|
/* Defined if Sleep exists. */
|
|
|
|
#undef _GLIBCXX_USE_WIN32_SLEEP
|
|
|
|
|
2023-09-15 20:43:43 +08:00
|
|
|
/* Define if _get_osfhandle should be used for filebuf::native_handle(). */
|
|
|
|
#undef _GLIBCXX_USE__GET_OSFHANDLE
|
|
|
|
|
2012-09-10 07:08:48 +08:00
|
|
|
/* Define to 1 if a verbose library is built, or 0 otherwise. */
|
|
|
|
#undef _GLIBCXX_VERBOSE
|
|
|
|
|
2012-09-10 01:20:42 +08:00
|
|
|
/* Defined if as can handle rdrand. */
|
|
|
|
#undef _GLIBCXX_X86_RDRAND
|
|
|
|
|
2019-05-29 22:45:35 +08:00
|
|
|
/* Defined if as can handle rdseed. */
|
|
|
|
#undef _GLIBCXX_X86_RDSEED
|
|
|
|
|
2023-01-14 21:33:58 +08:00
|
|
|
/* Define if a directory should be searched for tzdata files. */
|
libstdc++: Implement C++20 time zone support in <chrono>
This is the largest missing piece of C++20 support. Only the cxx11 ABI
is supported, due to the use of std::string in the API for time zones.
For the old gcc4 ABI, utc_clock and leap seconds are supported, but only
using a hardcoded list of leap seconds, no up-to-date tzdb::leap_seconds
information is available, and no time zones or zoned_time conversions.
The implementation currently depends on a tzdata.zi file being provided
by the OS or the user. The expected location is /usr/share/zoneinfo but
that can be changed using --with-libstdcxx-zoneinfo-dir=PATH. On targets
that support it there is also a weak symbol that users can override in
their own program (which also helps with testing):
extern "C++" const char* __gnu_cxx::zoneinfo_dir_override();
If no file is found, a fallback tzdb object will be created which only
contains the "Etc/UTC" and "Etc/GMT" time zones.
A leapseconds file is also expected in the same directory, but if that
isn't present then a hardcoded list of leapseconds is used, which is
correct at least as far as 2023-06-28 (and it currently looks like no
leap second will be inserted for a few years).
The tzdata.zi and leapseconds files from https://www.iana.org/time-zones
are in the public domain, so shipping copies of them with GCC would be
an option. However, the tzdata.zi file will rapidly become outdated, so
users should really provide it themselves (or convince their OS vendor
to do so). It would also be possible to implement an alternative parser
for the compiled tzdata files (one per time zone) under
/usr/share/zoneinfo. Those files are present on more operating systems,
but do not contain all the information present in tzdata.zi.
Specifically, the "links" are not present, so that e.g. "UTC" and
"Universal" are distinct time zones, rather than both being links to the
canonical "Etc/UTC" zone. For some platforms those files are hard links
to the same file, but there's no indication which zone is the canonical
name and which is a link. Other platforms just store them in different
inodes anyway. I do not plan to add such an alternative parser for the
compiled files. That would need to be contributed by maintainers or
users of targets that require it, if making tzdata.zi available is not
an option. The library ABI would not need to change for a new tzdb
implementation, because everything in tzdb_list, tzdb and time_zone is
implemented as a pimpl (except for the shared_ptr links between nodes,
described below). That means the new exported symbols added by this
commit should be stable even if the implementation is completely
rewritten.
The information from tzdata.zi is parsed and stored in data structures
that closely model the info in the file. This is a space-efficient
representation that uses less memory that storing every transition for
every time zone. It also avoids spending time expanding that
information into time zone transitions that might never be needed by the
program. When a conversion to/from a local time to UTC is requested the
information will be processed to determine the time zone transitions
close to the time being converted.
There is a bug in some time zone transitions. When generating a sys_info
object immediately after one that was previously generated, we need to
find the previous rule that was in effect and note its offset and
letters. This is so that the start time and abbreviation of the new
sys_info will be correct. This only affects time zones that use a format
like "C%sT" where the LETTERS replacing %s are non-empty for standard
time, e.g. "Asia/Shanghai" which uses "CST" for standard time and "CDT"
for daylight time.
The tzdb_list structure maintains a linked list of tzdb nodes using
shared_ptr links. This allows the iterators into the list to share
ownership with the list itself. This offers a non-portable solution to a
lifetime issue in the API. Because tzdb objects can be erased from the
list using tzdb_list::erase_after, separate modules/libraries in a large
program cannot guarantee that any const tzdb& or const time_zone*
remains valid indefinitely. Holding onto a tzdb_list::const_iterator
will extend the tzdb object's lifetime, even if it's erased from the
list. An alternative design would be for the list iterator to hold a
weak_ptr. This would allow users to test whether the tzdb still exists
when the iterator is dereferenced, which is better than just having a
dangling raw pointer. That doesn't actually extend the tzdb's lifetime
though, and every use of it would need to be preceded by checking the
weak_ptr. Using shared_ptr adds a little bit of overhead but allows
users to solve the lifetime issue if they rely on the libstdc++-specific
iterator property.
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_ZONEINFO_DIR): New macro.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver: Export new symbols.
* configure: Regenerate.
* configure.ac (GLIBCXX_ZONEINFO_DIR): Use new macro.
* include/std/chrono (utc_clock::from_sys): Correct handling
of leap seconds.
(nonexistent_local_time::_M_make_what_str): Define.
(ambiguous_local_time::_M_make_what_str): Define.
(__throw_bad_local_time): Define new function.
(time_zone, tzdb_list, tzdb): Implement all members.
(remote_version, zoned_time, get_leap_second_info): Define.
* include/std/version: Add comment for __cpp_lib_chrono.
* src/c++20/Makefile.am: Add new file.
* src/c++20/Makefile.in: Regenerate.
* src/c++20/tzdb.cc: New file.
* testsuite/lib/libstdc++.exp: Define effective target tzdb.
* testsuite/std/time/clock/file/members.cc: Check file_time
alias and file_clock::now() member.
* testsuite/std/time/clock/gps/1.cc: Likewise for gps_clock.
* testsuite/std/time/clock/tai/1.cc: Likewise for tai_clock.
* testsuite/std/time/syn_c++20.cc: Uncomment everything except
parse.
* testsuite/std/time/clock/utc/leap_second_info.cc: New test.
* testsuite/std/time/exceptions.cc: New test.
* testsuite/std/time/time_zone/get_info_local.cc: New test.
* testsuite/std/time/time_zone/get_info_sys.cc: New test.
* testsuite/std/time/time_zone/requirements.cc: New test.
* testsuite/std/time/tzdb/1.cc: New test.
* testsuite/std/time/tzdb/leap_seconds.cc: New test.
* testsuite/std/time/tzdb_list/1.cc: New test.
* testsuite/std/time/tzdb_list/requirements.cc: New test.
* testsuite/std/time/zoned_time/1.cc: New test.
* testsuite/std/time/zoned_time/custom.cc: New test.
* testsuite/std/time/zoned_time/deduction.cc: New test.
* testsuite/std/time/zoned_time/req_neg.cc: New test.
* testsuite/std/time/zoned_time/requirements.cc: New test.
* testsuite/std/time/zoned_traits.cc: New test.
2022-12-22 08:37:54 +08:00
|
|
|
#undef _GLIBCXX_ZONEINFO_DIR
|
|
|
|
|
2011-07-16 05:52:06 +08:00
|
|
|
/* Define to 1 if mutex_timedlock is available. */
|
|
|
|
#undef _GTHREAD_USE_MUTEX_TIMEDLOCK
|
|
|
|
|
2019-10-04 23:08:23 +08:00
|
|
|
/* Define for large files, on AIX-style hosts. */
|
|
|
|
#undef _LARGE_FILES
|
|
|
|
|
2016-11-22 00:09:47 +08:00
|
|
|
/* Define if all C++11 floating point overloads are available in <math.h>. */
|
2015-11-24 21:15:43 +08:00
|
|
|
#if __cplusplus >= 201103L
|
2016-11-22 00:09:47 +08:00
|
|
|
#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Define if all C++11 integral type overloads are available in <math.h>. */
|
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
|
2015-11-24 21:15:43 +08:00
|
|
|
#endif
|