From f14d702e4aa2fd28cdbef7c60c8dbe9cda82bed1 Mon Sep 17 00:00:00 2001 From: JulianSmart Date: Tue, 30 May 2017 19:23:03 +0100 Subject: [PATCH] Limit LOCALE_SNAME avoidance to VS2010 --- src/common/intl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 005d6bc23e..5d816b284d 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -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)) ) {