Limit LOCALE_SNAME avoidance to VS2010

This commit is contained in:
JulianSmart 2017-05-30 19:23:03 +01:00
parent 9af43c8c06
commit f14d702e4a

View File

@ -151,9 +151,11 @@ wxString wxLanguageInfo::GetLocaleName() const
wxChar buffer[256];
buffer[0] = wxT('\0');
// wxLANGUAGE_NORWEGIAN_BOKMAL crashes mbstowcs, but using LOCALE_SNAME can fail
// for e.g. wxLANGUAGE_ENGLISH, so at least limit the damage.
if ( Language == wxLANGUAGE_NORWEGIAN_BOKMAL && wxGetWinVersion() >= wxWinVersion_Vista )
// for e.g. wxLANGUAGE_ENGLISH in VS 2010 (other versions?)
#if !defined(__VISUALC__) || (__VISUALC__ != 1600)
if ( wxGetWinVersion() >= wxWinVersion_Vista )
{
if ( ::GetLocaleInfo(lcid, LOCALE_SNAME, buffer, WXSIZEOF(buffer)) )
{
@ -165,6 +167,7 @@ wxString wxLanguageInfo::GetLocaleName() const
}
return locale;
}
#endif
if ( !::GetLocaleInfo(lcid, LOCALE_SENGLANGUAGE, buffer, WXSIZEOF(buffer)) )
{