From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 505903858020; Thu, 29 Jun 2023 23:01:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 505903858020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688079669; bh=ZUWvW9Xf7N7imVSTwyoVsIdrzWuPghvdkC4clbuQOq8=; h=From:To:Subject:Date:From; b=oz+JKqXP+QarRpZElcTcEnUXh0r1mWj7eUf/6NjJuiv8PLvFCx2WhcAL4ZgmcCS+u tPi9qNQ9WaX6v/lPe/6og4VwnnDN49hwMCQqZJY/B1I7/KLrrtpJW6dG8lU61i0GfV 065sir+/Rxr7cRXQwB+EoFPHjWrECMvLtZDmJ4UM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-7508] libstdc++: Add preprocessor checks to [PR100285] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-13 X-Git-Oldrev: aa087355c724b883189a3d2964e3050abef3dadf X-Git-Newrev: 132015b9c6c9f9156ff31f7d66ba92cf01d0bc90 Message-Id: <20230629230109.505903858020@sourceware.org> Date: Thu, 29 Jun 2023 23:01:09 +0000 (GMT) List-Id: https://gcc.gnu.org/g:132015b9c6c9f9156ff31f7d66ba92cf01d0bc90 commit r13-7508-g132015b9c6c9f9156ff31f7d66ba92cf01d0bc90 Author: Jonathan Wakely Date: Fri Jun 9 12:15:21 2023 +0100 libstdc++: Add preprocessor checks to [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) Diff: --- libstdc++-v3/include/experimental/internet | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/include/experimental/internet b/libstdc++-v3/include/experimental/internet index 1f63c61ce85..bd9a05f12aa 100644 --- a/libstdc++-v3/include/experimental/internet +++ b/libstdc++-v3/include/experimental/internet @@ -1502,6 +1502,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 class basic_endpoint @@ -2187,6 +2188,7 @@ namespace ip __ec = std::make_error_code(errc::operation_not_supported); #endif } +#endif // IPPROTO_TCP || IPPROTO_UDP /** The name of the local host. * @{