diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-04-27 13:06:43 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-04-27 14:04:36 +0100 |
commit | 9ee35a8685ee174c6914059143aceb7009d3e920 (patch) | |
tree | 78d0c0a9f2212f3b9f17b8bf7d85514b7ecfd665 /gcc/tree-stdarg.c | |
parent | 8aadb4fedb17e7a44583a7a5a4e96b1874e1ce98 (diff) | |
download | gcc-9ee35a8685ee174c6914059143aceb7009d3e920.zip gcc-9ee35a8685ee174c6914059143aceb7009d3e920.tar.gz gcc-9ee35a8685ee174c6914059143aceb7009d3e920.tar.bz2 |
libstdc++: Better preprocessor conditions in net::ip [PR 100286]
This improves the use of preprocessor conditionas to enable/disable
members of namespace net::ip according to what is supported by the
target. This fixes PR 100286 by ensuring that the to_string member
functions are always defined for the address_v4 and address_v6 classes.
On the other hand, the IP protocol classes and internet socket option
classes aren't useful at all if the corresponding constants (such as
IPPROTO_TCP or IPV6_MULTICAST_HOPS) aren't define. So those types are
not defined at all if they can't be used.
The net/internet/socket/opt.cc test uses __has_include to check whether
or not to expect the types to be available.
libstdc++-v3/ChangeLog:
PR libstdc++/100286
* include/experimental/internet (resolver_errc, resolver_category())
(make_error_code, make_error_condition): Define unconditionally,
only make enumerators and use of gai_strerror depend on the
availability of <netdb.h>.
(address_v4::to_string): Use correct constant for string length.
(address_v4::to_string, address_v6::to_string): Define
unconditionally, throw if unsupported.
(make_address_v4, make_address_v6): Define unconditionally.
Return an error if unsupported.
(tcp, udp, v6_only, unicast::hops, multicast::*): Define
conditionally,
* testsuite/experimental/net/internet/socket/opt.cc: Check for
<netinet/in.h> and <netinet/tcp.h> before using types from
namespace net::ip.
Diffstat (limited to 'gcc/tree-stdarg.c')
0 files changed, 0 insertions, 0 deletions