public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8649] libstdc++: Enable std::text_encoding for darwin and FreeBSD
@ 2024-01-31  9:53 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2024-01-31  9:53 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:9bf91fa360156476bce9899394f81b1e875593f4

commit r14-8649-g9bf91fa360156476bce9899394f81b1e875593f4
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Jan 30 14:28:09 2024 +0000

    libstdc++: Enable std::text_encoding for darwin and FreeBSD
    
    The <xlocale.h> header is needed for newlocale and locale_t on these
    targets.
    
    libstdc++-v3/ChangeLog:
    
            * acinclude.m4 (GLIBCXX_CHECK_TEXT_ENCODING): Use <xlocale.h> if
            needed for newlocale.
            * configure: Regenerate.
            * src/c++26/text_encoding.cc: Use <xlocale.h>.
    
    Reviewed-by: Iain Sandoe <iain@sandoe.co.uk>

Diff:
---
 libstdc++-v3/acinclude.m4               | 3 +++
 libstdc++-v3/configure                  | 3 +++
 libstdc++-v3/src/c++26/text_encoding.cc | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index f9ba7ef744b0..f72bd0f45b8b 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -5834,6 +5834,9 @@ AC_LANG_SAVE
   AC_MSG_CHECKING([whether nl_langinfo_l is defined in <langinfo.h>])
   AC_TRY_COMPILE([
   #include <locale.h>
+  #if __has_include(<xlocale.h>)
+  # include <xlocale.h>
+  #endif
   #include <langinfo.h>
   ],[
     locale_t loc = newlocale(LC_ALL_MASK, "", (locale_t)0);
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 65ce679f1bdd..f4bc04867683 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -54533,6 +54533,9 @@ $as_echo_n "checking whether nl_langinfo_l is defined in <langinfo.h>... " >&6;
 /* end confdefs.h.  */
 
   #include <locale.h>
+  #if __has_include(<xlocale.h>)
+  # include <xlocale.h>
+  #endif
   #include <langinfo.h>
 
 int
diff --git a/libstdc++-v3/src/c++26/text_encoding.cc b/libstdc++-v3/src/c++26/text_encoding.cc
index 33c6c07820c7..b9a50ef1a001 100644
--- a/libstdc++-v3/src/c++26/text_encoding.cc
+++ b/libstdc++-v3/src/c++26/text_encoding.cc
@@ -27,6 +27,9 @@
 
 #ifdef _GLIBCXX_USE_NL_LANGINFO_L
 #include <locale.h>
+#if __has_include(<xlocale.h>)
+# include <xlocale.h>
+#endif
 #include <langinfo.h>
 
 #if __CHAR_BIT__ == 8

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-31  9:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31  9:53 [gcc r14-8649] libstdc++: Enable std::text_encoding for darwin and FreeBSD Jonathan Wakely

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