summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glib/glibmm/ustring.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/glib/glibmm/ustring.cc b/glib/glibmm/ustring.cc
index c9895fb5..abd1b580 100644
--- a/glib/glibmm/ustring.cc
+++ b/glib/glibmm/ustring.cc
@@ -1364,7 +1364,7 @@ ustring::FormatStream::to_string() const
#ifdef GLIBMM_HAVE_WIDE_STREAM
const std::wstring str = stream_.str();
-#if defined(__STDC_ISO_10646__) && SIZEOF_WCHAR_T == 4
+#if (defined(__STDC_ISO_10646__) || defined(_LIBCPP_VERSION)) && SIZEOF_WCHAR_T == 4
// Avoid going through iconv if wchar_t always contains UCS-4.
glong n_bytes = 0;
const auto buf = make_unique_ptr_gfree(g_ucs4_to_utf8(
@@ -1452,7 +1452,7 @@ operator>>(std::wistream& is, ustring& utf8_string)
std::wstring wstr;
is >> wstr;
-#if defined(__STDC_ISO_10646__) && SIZEOF_WCHAR_T == 4
+#if (defined(__STDC_ISO_10646__) || defined(_LIBCPP_VERSION)) && SIZEOF_WCHAR_T == 4
// Avoid going through iconv if wchar_t always contains UCS-4.
glong n_bytes = 0;
const auto buf = make_unique_ptr_gfree(g_ucs4_to_utf8(
@@ -1483,7 +1483,7 @@ operator<<(std::wostream& os, const ustring& utf8_string)
{
GError* error = nullptr;
-#if defined(__STDC_ISO_10646__) && SIZEOF_WCHAR_T == 4
+#if (defined(__STDC_ISO_10646__) || defined(_LIBCPP_VERSION)) && SIZEOF_WCHAR_T == 4
// Avoid going through iconv if wchar_t always contains UCS-4.
const auto buf = make_unique_ptr_gfree(
g_utf8_to_ucs4(utf8_string.raw().data(), utf8_string.raw().size(), nullptr, nullptr, &error));