aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-06-09 12:15:21 +0100
committerJonathan Wakely <jwakely@redhat.com>2024-06-11 13:35:08 +0100
commit3494bc7b03997f96e84e84f6904917854466d5ea (patch)
tree395cb741539ff0a7310e91fd63c431d4428ca34a
parent874896659df65b4bdf85b3dbca0ab527bb4c920e (diff)
downloadgcc-3494bc7b03997f96e84e84f6904917854466d5ea.zip
gcc-3494bc7b03997f96e84e84f6904917854466d5ea.tar.gz
gcc-3494bc7b03997f96e84e84f6904917854466d5ea.tar.bz2
libstdc++: Add preprocessor checks to <experimental/internet> [PR100285]
We can't define endpoints and resolvers without the relevant OS support. If IPPROTO_TCP and IPPROTO_UDP are both undefined then we won't need basic_endpoint and basic_resolver anyway, so make them depend on those macros. libstdc++-v3/ChangeLog: PR libstdc++/100285 * include/experimental/internet [IPPROTO_TCP || IPPROTO_UDP] (basic_endpoint, basic_resolver_entry, resolver_base) (basic_resolver_results, basic_resolver): Only define if the tcp or udp protocols will be defined. (cherry picked from commit 793ed718b522b15e2d758eca953feeec1979fe2c)
-rw-r--r--libstdc++-v3/include/experimental/internet2
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/include/experimental/internet b/libstdc++-v3/include/experimental/internet
index 4be4bfb..5b05b0f 100644
--- a/libstdc++-v3/include/experimental/internet
+++ b/libstdc++-v3/include/experimental/internet
@@ -1457,6 +1457,7 @@ namespace ip
operator<<(basic_ostream<_CharT, _Traits>& __os, const network_v6& __net)
{ return __os << __net.to_string(); }
+#if defined IPPROTO_TCP || defined IPPROTO_UDP
/// An IP endpoint.
template<typename _InternetProtocol>
class basic_endpoint
@@ -2091,6 +2092,7 @@ namespace ip
__ec = std::make_error_code(errc::operation_not_supported);
#endif
}
+#endif // IPPROTO_TCP || IPPROTO_UDP
/** The name of the local host.
* @{