]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Enable std::text_encoding for darwin and FreeBSD
authorJonathan Wakely <jwakely@redhat.com>
Tue, 30 Jan 2024 14:28:09 +0000 (14:28 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 31 Jan 2024 09:42:39 +0000 (09:42 +0000)
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>
libstdc++-v3/acinclude.m4
libstdc++-v3/configure
libstdc++-v3/src/c++26/text_encoding.cc

index f9ba7ef744b0c24882924e86d130a105739a3a3f..f72bd0f45b8bd88af69460658189709d7b7861d9 100644 (file)
@@ -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);
index 65ce679f1bdd01e51a1b71b1b79f54dc2626dd64..f4bc048676839515ce9b169db0393ce45e5bb533 100755 (executable)
@@ -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
index 33c6c07820c7bc2ac829c897c56d728a1618386e..b9a50ef1a001f6b4f56468c05244226309e077d7 100644 (file)
@@ -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