From patchwork Sat Nov 12 01:43:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 19066 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1061163wru; Fri, 11 Nov 2022 17:44:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf5S8LCsu77trfGjJ7FTnmSXjAl8g9X8p+7LXTKgH5XzSz7YrWAbwGmLxvWDRVLyF+hpijwB X-Received: by 2002:a17:906:3a9b:b0:7ad:dc7e:1b8d with SMTP id y27-20020a1709063a9b00b007addc7e1b8dmr3818150ejd.276.1668217499357; Fri, 11 Nov 2022 17:44:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668217499; cv=none; d=google.com; s=arc-20160816; b=F6Dm1C33c4r5NjvT9VsI0CHG3PsESk02ekGpcXUHB5a/+5QbsqSCZ26FBkXsn0S2Kf SvLA6P4l4ZreyXzUgOgMirqMrhYt6CVQVlyXJiVw5Ea2Sn/eh5ss5tjtEAR7IQ4oBj5b qSEyY54RDZuHk3rpoK0XUNATVndw5ssnjyFqW0M2Hszif0h8LzVxobYV6iH89SxeGw+L Ons8SvmcfJaUaVlQpAj0CNF4dv8wHK1m+2BRs+pu+JvUqgQMTQV5+eoop9PE11OfcZoj vJgee2sbdXpB01rXMyGuBuF3hAeJHtQJdNtfa/6NiwF44Uy9FB4b9z3DsfZVpIVWHDFC sqZg== 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=Gj+f2zKqN59OdxDEyVS0J3jfTZjY0yuMC1bdAOXtMHM=; b=e5DN8fqe3PzyUHjI+5MVPDZLViGxL7uXq/G0zg0yHwU/ntzS7GO2t4k8RjGh5K4B9X nGGGIl+GLh5iE1q9IteI4VvE82Q+9+meoc1923ftVVbf1z1LIf03Tv7ULjnS/f1KWeY/ v48oX+H9JY3+I7r8oCXkV7YClOvbAQZV8S0WnKyKqg59WiRV0iw2OPBd8/EXLj5f5NCd knoYdbgVWIdnOqFUYutGEaFn7kr8vJ7tuo1ADIyt9d99NURwSSvpoV+nE+E/RWE/LlOv IjVsU2YsdAF/JPjIacuWy0pZs3vkYsB3cl2MlyySEfnmqU2U8yf8LYjioVbXDJf/FnRC yGtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="nDHWu/zo"; 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 19-20020a508e13000000b00461c12f1f4csi3079857edw.478.2022.11.11.17.44.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 17:44:59 -0800 (PST) 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="nDHWu/zo"; 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 C3A08388214C for ; Sat, 12 Nov 2022 01:44:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3A08388214C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668217484; bh=Gj+f2zKqN59OdxDEyVS0J3jfTZjY0yuMC1bdAOXtMHM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=nDHWu/zowlrfkFuGxec6HqAE9mb/7mqWS28PBSFk3sJDgv/VGfNUFvWAsB1VUw0/I kzSV1RIy0H1RIRCqXB4B56im0nTd7e/ok28b1EjSmsp42jifZXBt34GTXo2P2YMxkQ fV7u8iuAxanzcq0WKefpH0ELPt8qnZM+TnkN9TTE= 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 5B41E3858C60 for ; Sat, 12 Nov 2022 01:43:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5B41E3858C60 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-417-rHmsfg7yOde0hNZiMCifog-1; Fri, 11 Nov 2022 20:43:55 -0500 X-MC-Unique: rHmsfg7yOde0hNZiMCifog-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6E67F85A5A6; Sat, 12 Nov 2022 01:43:55 +0000 (UTC) Received: from localhost (unknown [10.33.36.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3782549BB60; Sat, 12 Nov 2022 01:43:55 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Define INSTANTIATE_FACET_ACCESSORS macro in compat source [PR103755] Date: Sat, 12 Nov 2022 01:43:53 +0000 Message-Id: <20221112014353.810822-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable 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?1749252832547814310?= X-GMAIL-MSGID: =?utf-8?q?1749252832547814310?= This fixes a build failure on powerpc64le when using ieeelongdouble as the default. Tested x86_64-linux. Pushed to trunk. -- >8 -- compatibility-ldbl-alt128.cc re-includes locale-inst-numeric.h and locale-inst-monetary.h but wasn't defining the macros added in r13-3888-gb3ac43a3c05744. Put those macros in a new internal header that can be included everywhere they're used. libstdc++-v3/ChangeLog: PR libstdc++/103755 * src/c++11/locale-inst-monetary.h: Include new header. * src/c++11/locale-inst-numeric.h: Likewise. * src/c++11/locale-inst.cc: Likewise. (INSTANTIATE_USE_FACET, INSTANTIATE_FACET_ACCESSORS): Move macro definitions to ... * src/c++11/facet_inst_macros.h: New file. --- libstdc++-v3/src/c++11/facet_inst_macros.h | 17 +++++++++++++++++ libstdc++-v3/src/c++11/locale-inst-monetary.h | 2 ++ libstdc++-v3/src/c++11/locale-inst-numeric.h | 2 ++ libstdc++-v3/src/c++11/locale-inst.cc | 12 +----------- 4 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 libstdc++-v3/src/c++11/facet_inst_macros.h diff --git a/libstdc++-v3/src/c++11/facet_inst_macros.h b/libstdc++-v3/src/c++11/facet_inst_macros.h new file mode 100644 index 00000000000..e0a07b1d2f7 --- /dev/null +++ b/libstdc++-v3/src/c++11/facet_inst_macros.h @@ -0,0 +1,17 @@ +#ifndef _FACET_INST_MACROS_H +#define _FACET_INST_MACROS_H + +// These macros are used for explicit instantiation definitions in src/c++11/ + +#define INSTANTIATE_USE_FACET(...) \ + template const __VA_ARGS__* \ + __try_use_facet< __VA_ARGS__ >(const locale&) noexcept; \ + template const __VA_ARGS__& \ + use_facet<__VA_ARGS__>(const locale&) + +#define INSTANTIATE_FACET_ACCESSORS(...) \ + INSTANTIATE_USE_FACET(__VA_ARGS__); \ + template bool \ + has_facet<__VA_ARGS__>(const locale&) noexcept + +#endif // _FACET_INST_MACROS_H diff --git a/libstdc++-v3/src/c++11/locale-inst-monetary.h b/libstdc++-v3/src/c++11/locale-inst-monetary.h index ff8439857d2..26b1e33d3a7 100644 --- a/libstdc++-v3/src/c++11/locale-inst-monetary.h +++ b/libstdc++-v3/src/c++11/locale-inst-monetary.h @@ -26,6 +26,8 @@ #define "This file should not be compiled directly, only included" #endif +#include "facet_inst_macros.h" + // This header is included multiple times, to instantiate these symbols // for char/wchar_t and for both std::string ABIs, // and (depending on the target) for two long double formats. diff --git a/libstdc++-v3/src/c++11/locale-inst-numeric.h b/libstdc++-v3/src/c++11/locale-inst-numeric.h index 4b970f75f6e..18514e892af 100644 --- a/libstdc++-v3/src/c++11/locale-inst-numeric.h +++ b/libstdc++-v3/src/c++11/locale-inst-numeric.h @@ -26,6 +26,8 @@ #define "This file should not be compiled directly, only included" #endif +#include "facet_inst_macros.h" + namespace std _GLIBCXX_VISIBILITY(default) { #if ! _GLIBCXX_USE_CXX11_ABI diff --git a/libstdc++-v3/src/c++11/locale-inst.cc b/libstdc++-v3/src/c++11/locale-inst.cc index b264cb381ec..6767da74b74 100644 --- a/libstdc++-v3/src/c++11/locale-inst.cc +++ b/libstdc++-v3/src/c++11/locale-inst.cc @@ -43,19 +43,9 @@ # define C_is_char #endif -#define INSTANTIATE_USE_FACET(...) \ - template const __VA_ARGS__* \ - __try_use_facet< __VA_ARGS__ >(const locale&) noexcept; \ - template const __VA_ARGS__& \ - use_facet<__VA_ARGS__>(const locale&) \ - -#define INSTANTIATE_FACET_ACCESSORS(...) \ - INSTANTIATE_USE_FACET(__VA_ARGS__); \ - template bool \ - has_facet<__VA_ARGS__>(const locale&) noexcept - #include "locale-inst-numeric.h" #include "locale-inst-monetary.h" +#include "facet_inst_macros.h" namespace std _GLIBCXX_VISIBILITY(default) {