From patchwork Fri Jun 9 12:19:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 105590 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp904226vqr; Fri, 9 Jun 2023 05:20:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6uVSIKBuOK58+7draVXbJF+hhuvDxPntfyaCGU+3qhJCfj9e8neUYsWugQW0V+Hrppafg9 X-Received: by 2002:a17:907:2ce5:b0:978:af9d:4d4c with SMTP id hz5-20020a1709072ce500b00978af9d4d4cmr1841428ejc.75.1686313224471; Fri, 09 Jun 2023 05:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686313224; cv=none; d=google.com; s=arc-20160816; b=CdOhzKxUaaGdOC9p9yGHjz5i6Xc48iol6RHQ2Y4xwVaSRhGUSyy/g62Ob8bKU6KRoa rT1YGfhkY0Ea51FoO6TT9vAQ0aLRRy5wxvRRJnL8lmI6Z3lSz4qP8wkzLbAih9+sADlt 0d91vxDWDdYp8t3LYFL5D3CLK8si21wF9Kd0LaoE5hO6IfFEp5fckz8mtU77aSVscI0l Kry/bj0rI7WOCOSPuZ40W6nh7YFvDGF4RKvbPh7qt84qso06/8KDLCK2SDGkzcY6euUT 3jeoztUAjmVmnusvS8T1zkassOTCOfHv7yf5rcPBbb+PKKq9HMeeGB2M6eP0dXzl7779 5b7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=IN0dzYJXL3iXwT/Rg+k6g68FjKmScIaZMjLNtllos9A=; b=iCCcObwuzYhQs5FBo2pU57dcdHWC83E+b1JvqIi6Bt2aLOpd4pWour511PuwTHxaTm qDgBIb8qN97UAadYwYFewqLxVR6Lx/DQGNkaqdrbNs2XEUSkpyr/zOU+jqIo7uuYrdyA RGjz3kvma7Fv525BrBp6FnykEwz2ddoyW7d0uLU8ZfF8GJvui2Q1nG2s7SViqDsErrA9 rJ3wuYjxiw4TB6Cf/mTVhG34HcfDK8WkIPARixo9LjlqNScvh8Sw/tWx84efUWhx6Zvr FUUxcc1Rh9rHanpuL93/n4nm3Ipm7VY8fXtfd9vC0WcHtN7Kp7eW+bl/io3JzEM4BwSa /ABg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nnhyOGGG; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q21-20020a170906541500b00974d5805d22si1441083ejo.727.2023.06.09.05.20.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 05:20:24 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nnhyOGGG; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A2110385C6DB for ; Fri, 9 Jun 2023 12:19:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2110385C6DB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686313186; bh=IN0dzYJXL3iXwT/Rg+k6g68FjKmScIaZMjLNtllos9A=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=nnhyOGGGflMCtlKuqQGIOuWPz0//QTl9e62eBTCxMsVaXK2/YAThJOFpZgnt0wkIr /XXEth85ORV1E7VfsaqAMCRgRP5kfHcwL8J1HTxo5B5xDK/2PWLtXAmHmyv0flipcV dkaBpwOCgux33LZaCX32lpz81+YjgeQ57BhpTOiI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1ACA03856DD6 for ; Fri, 9 Jun 2023 12:19:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1ACA03856DD6 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-435-LKvTZKBKNV-4oXbOcvXjzQ-1; Fri, 09 Jun 2023 08:19:03 -0400 X-MC-Unique: LKvTZKBKNV-4oXbOcvXjzQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 048698037AD; Fri, 9 Jun 2023 12:19:03 +0000 (UTC) Received: from localhost (unknown [10.42.28.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 772FE2166B25; Fri, 9 Jun 2023 12:19:02 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add preprocessor checks to [PR100285] Date: Fri, 9 Jun 2023 13:19:00 +0100 Message-Id: <20230609121900.307482-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768227575390778188?= X-GMAIL-MSGID: =?utf-8?q?1768227575390778188?= Tested x86_64-linux. Pushed to trunk. --> 8-- We can't define endpoints and resolvers without the relevant OS support. If IPPROTO_TCP and IPPROTO_UDP are both udnefined then we won't need basic_endpoint and basic_resovler 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. --- 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. * @{