aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/config/locale/gnu/messages_members.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/config/locale/gnu/messages_members.cc')
-rw-r--r--libstdc++-v3/config/locale/gnu/messages_members.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/libstdc++-v3/config/locale/gnu/messages_members.cc b/libstdc++-v3/config/locale/gnu/messages_members.cc
index 2717c6b55e1..54a3c8fa9f6 100644
--- a/libstdc++-v3/config/locale/gnu/messages_members.cc
+++ b/libstdc++-v3/config/locale/gnu/messages_members.cc
@@ -34,6 +34,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
+#include "c++locale_internal.h"
namespace std
{
@@ -56,4 +57,25 @@ namespace std
return string(__msg);
#endif
}
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ template<>
+ wstring
+ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
+ {
+# if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ __c_locale __old = __uselocale(_M_c_locale_messages);
+ char* __msg = gettext(_M_convert_to_char(__dfault));
+ __uselocale(__old);
+ return _M_convert_from_char(__msg);
+# else
+ char* __old = strdup(setlocale(LC_ALL, NULL));
+ setlocale(LC_ALL, _M_name_messages);
+ char* __msg = gettext(_M_convert_to_char(__dfault));
+ setlocale(LC_ALL, __old);
+ free(__old);
+ return _M_convert_from_char(__msg);
+# endif
+ }
+#endif
}