From 79142a262ec0a02f9a43a71dd226f78a1d7cbeed Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 15 Oct 2015 11:22:25 +0200 Subject: prepare better solution of Glib's << operator --- libs/gtkmm2ext/gtkmm2ext/utils.h | 9 +++++++++ libs/gtkmm2ext/utils.cc | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/libs/gtkmm2ext/gtkmm2ext/utils.h b/libs/gtkmm2ext/gtkmm2ext/utils.h index 62ffba3b9c..688f4431c6 100644 --- a/libs/gtkmm2ext/gtkmm2ext/utils.h +++ b/libs/gtkmm2ext/gtkmm2ext/utils.h @@ -161,6 +161,15 @@ namespace Gtkmm2ext { LIBGTKMM2EXT_API void convert_bgra_to_rgba (guint8 const *, guint8 * dst, int, int); LIBGTKMM2EXT_API const char* event_type_string (int event_type); + + /* glibmm ustring workaround + * + * Glib::operator<<(std::ostream&, Glib::ustring const&) internally calls + * g_locale_from_utf8() which uses loadlocale which is not thread-safe on OSX + * + * use a std::string + */ + LIBGTKMM2EXT_API std::string markup_escape_text (std::string const& s); }; #endif /* __gtkmm2ext_utils_h__ */ diff --git a/libs/gtkmm2ext/utils.cc b/libs/gtkmm2ext/utils.cc index 4cfc0b26a0..3762f88dd6 100644 --- a/libs/gtkmm2ext/utils.cc +++ b/libs/gtkmm2ext/utils.cc @@ -967,3 +967,9 @@ Gtkmm2ext::event_type_string (int event_type) return "unknown"; } + +std::string +Gtkmm2ext::markup_escape_text (std::string const& s) +{ + return Glib::Markup::escape_text (s); +} -- cgit v1.2.3