wxSetlocale() doesn't always return NULL

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-12-06 14:14:19 +00:00
parent 28a4627cfe
commit 929eed4799

View File

@@ -191,9 +191,16 @@ WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_pt
#ifndef wxSetlocale #ifndef wxSetlocale
WXDLLEXPORT wxChar * wxSetlocale(int category, const wxChar *locale) WXDLLEXPORT wxChar * wxSetlocale(int category, const wxChar *locale)
{ {
setlocale(category, wxConvLibc.cWX2MB(locale)); #ifdef wxUSE_THREADS
// FIXME wxASSERT_MSG( wxThread::IsMain(), _T("wxSetlocale() is not MT-safe") );
return (wxChar *)NULL; #endif
static wxWCharBuffer s_wzLocale;
char *localeOld = setlocale(category, wxConvLibc.cWX2MB(locale));
s_wzLocale = wxConvLibc.cMB2WC(localeOld);
return s_wzLocale;
} }
#endif #endif