#if wxUSE_WCSRTOMBS
// don't know if it's really needed (or if we can pass NULL), but better safe
// than quick
- mbstate_t mbstate;
+ mbstate_t mbstate;
return mbsrtowcs((wchar_t *) NULL, &psz, 0, &mbstate);
#else // !GNU libc
return mbstowcs((wchar_t *) NULL, psz, 0);
#if wxUSE_WCSRTOMBS
// don't know if it's really needed (or if we can pass NULL), but better safe
// than quick
- mbstate_t mbstate;
+ mbstate_t mbstate;
return wcsrtombs((char *) NULL, &pwz, 0, &mbstate);
#else // !GNU libc
return wcstombs((char *) NULL, pwz, 0);
#ifndef wxSetlocale
WXDLLEXPORT wxChar * wxSetlocale(int category, const wxChar *locale)
{
- setlocale(category, wxConvLibc.cWX2MB(locale));
- // FIXME
- return (wxChar *)NULL;
+#ifdef wxUSE_THREADS
+ wxASSERT_MSG( wxThread::IsMain(), _T("wxSetlocale() is not MT-safe") );
+#endif
+
+ static wxWCharBuffer s_wzLocale;
+
+ char *localeOld = setlocale(category, wxConvLibc.cWX2MB(locale));
+ s_wzLocale = wxConvLibc.cMB2WC(localeOld);
+
+ return s_wzLocale;
}
#endif