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 381603858D38 for ; Sat, 12 Nov 2022 01:43:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 381603858D38 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=1668217437; 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=Gj+f2zKqN59OdxDEyVS0J3jfTZjY0yuMC1bdAOXtMHM=; b=K2QI+pl7wYabF/LJXah2MtKxu8a6kKVgH1FRrVdUA1bfme3dkC6qDVx6CmUdLgyLJiX4gc 8deRfP6Wlx4a8C7z2GkbRY2FdFVOxGgy3haGMRsHOKhS5XM4dZmFYl/0E0rTVoN+1dc+4q mjs+cgc5bjrTOGD/LYstrKtdXb5jcow= 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) From: Jonathan Wakely 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 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,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: 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) { -- 2.38.1