View | Details | Raw Unified | Return to bug 232073
Collapse All | Expand All

(-)glibmm/files/patch-glib_glibmm_ustring.cc (+29 lines)
Line 0 Link Here
1
--- glib/glibmm/ustring.cc.orig	2017-08-30 14:13:30 UTC
2
+++ glib/glibmm/ustring.cc
3
@@ -1364,7 +1364,7 @@ ustring::FormatStream::to_string() const
4
 #ifdef GLIBMM_HAVE_WIDE_STREAM
5
   const std::wstring str = stream_.str();
6
 
7
-#if defined(__STDC_ISO_10646__) && SIZEOF_WCHAR_T == 4
8
+#if (defined(__STDC_ISO_10646__) || defined(_LIBCPP_VERSION)) && SIZEOF_WCHAR_T == 4
9
   // Avoid going through iconv if wchar_t always contains UCS-4.
10
   glong n_bytes = 0;
11
   const auto buf = make_unique_ptr_gfree(g_ucs4_to_utf8(
12
@@ -1452,7 +1452,7 @@ operator>>(std::wistream& is, ustring& utf8_string)
13
   std::wstring wstr;
14
   is >> wstr;
15
 
16
-#if defined(__STDC_ISO_10646__) && SIZEOF_WCHAR_T == 4
17
+#if (defined(__STDC_ISO_10646__) || defined(_LIBCPP_VERSION)) && SIZEOF_WCHAR_T == 4
18
   // Avoid going through iconv if wchar_t always contains UCS-4.
19
   glong n_bytes = 0;
20
   const auto buf = make_unique_ptr_gfree(g_ucs4_to_utf8(
21
@@ -1483,7 +1483,7 @@ operator<<(std::wostream& os, const ustring& utf8_stri
22
 {
23
   GError* error = nullptr;
24
 
25
-#if defined(__STDC_ISO_10646__) && SIZEOF_WCHAR_T == 4
26
+#if (defined(__STDC_ISO_10646__) || defined(_LIBCPP_VERSION)) && SIZEOF_WCHAR_T == 4
27
   // Avoid going through iconv if wchar_t always contains UCS-4.
28
   const auto buf = make_unique_ptr_gfree(
29
     g_utf8_to_ucs4(utf8_string.raw().data(), utf8_string.raw().size(), nullptr, nullptr, &error));

Return to bug 232073