public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r13-3917] libstdc++: Define INSTANTIATE_FACET_ACCESSORS macro in compat source [PR103755]
Date: Sat, 12 Nov 2022 01:30:00 +0000 (GMT)	[thread overview]
Message-ID: <20221112013000.E9EF83858D38@sourceware.org> (raw)

https://gcc.gnu.org/g:a7f51059fb009dcd7d491d6b2164bce75dbd9975

commit r13-3917-ga7f51059fb009dcd7d491d6b2164bce75dbd9975
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 11 22:36:01 2022 +0000

    libstdc++: Define INSTANTIATE_FACET_ACCESSORS macro in compat source [PR103755]
    
    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.

Diff:
---
 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(-)

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)
 {

                 reply	other threads:[~2022-11-12  1:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221112013000.E9EF83858D38@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).