Compilation workaround for older MinGW versions (Win only)

see issue 847
This commit is contained in:
Oliver Duis
2011-07-18 22:18:42 +02:00
parent 9716b235d6
commit fdb490c49f
2 changed files with 17 additions and 8 deletions

View File

@@ -96,11 +96,15 @@ bool MultiLangMgr::save (Glib::ustring fname) {
bool MultiLangMgr::isOSLanguageDetectSupported() {
#ifdef WIN32
#ifdef __MINGW64_VERSION_MAJOR
// Only on Vista or above
return LOBYTE(LOWORD(GetVersion()))>=6;
#else
return false;
#endif
#else
return false;
#endif
}
@@ -112,6 +116,8 @@ Glib::ustring MultiLangMgr::getOSUserLanguage() {
// TODO: Add support for other OS here
#ifdef WIN32
// When using old versions of MINGW this is not defined
#ifdef __MINGW64_VERSION_MAJOR
WCHAR langRFCU[64] = {0};
if (GetUserDefaultLocaleName(langRFCU,64)!=0 && lstrlenW(langRFCU)>=2) {
// convert UNICODE16 to GTK
@@ -121,6 +127,7 @@ Glib::ustring MultiLangMgr::getOSUserLanguage() {
langName=TranslateRFC2Language(localRFC);
}
#endif
#endif
} else printf("Automatic language detection not supported on your OS\n");