From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686313144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IN0dzYJXL3iXwT/Rg+k6g68FjKmScIaZMjLNtllos9A=; b=ihFUhoUL4AjJNuwRykdiSkYLz298218aHAAsMUHsjiiP83fQ+BX3P8SUREplN1iY9tox/1 ioFNIHQ0bddOY8OuecPdGvwBcMxEk3VbcbLifnEpbXnBXJQyqheCd6DOLeVfrMzEY6E56Z eXWid+86SJ9lvxnrmRCUGeNw4tusAvg= 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) From: Jonathan Wakely 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 Content-Type: text/plain Content-Transfer-Encoding: 8bit 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 List-Id: 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. * @{ -- 2.40.1