From f8512798a2562dca98e8d8be0a89b99668271222 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Fri, 30 Sep 2011 20:17:42 +0200 Subject: [PATCH] Added hack to disable 'x64' support on Windows 8 Developer Preview, as our MPress-compressed x64 binaries currently crash on that platform. It's not yet clear whether Windows 8 or MPress is at fault... --- etc/Translation/Blank.ts | 6 +++--- src/Config.h | 2 +- src/Global.cpp | 21 ++++++++++++++++++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index fc11c2cc..6e7f23b1 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -2689,17 +2689,17 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. - + Executable '%1' requires Qt v%2, but found Qt v%3. - + Executable '%1' requires Windows 2000 or later. diff --git a/src/Config.h b/src/Config.h index f0b44cc1..67f2f7c6 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 3 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 3 -#define VER_LAMEXP_BUILD 706 +#define VER_LAMEXP_BUILD 707 /////////////////////////////////////////////////////////////////////////////// // Tools versions diff --git a/src/Global.cpp b/src/Global.cpp index bcf07649..7f43e3d9 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -516,12 +516,14 @@ lamexp_cpu_t lamexp_detect_cpu_features(int argc, char **argv) lamexp_cpu_t features; SYSTEM_INFO systemInfo; + OSVERSIONINFO osVersionInfo; int CPUInfo[4] = {-1}; char CPUIdentificationString[0x40]; char CPUBrandString[0x40]; memset(&features, 0, sizeof(lamexp_cpu_t)); memset(&systemInfo, 0, sizeof(SYSTEM_INFO)); + memset(&osVersionInfo, 0, sizeof(OSVERSIONINFO)); memset(CPUIdentificationString, 0, sizeof(CPUIdentificationString)); memset(CPUBrandString, 0, sizeof(CPUBrandString)); @@ -600,15 +602,28 @@ lamexp_cpu_t lamexp_detect_cpu_features(int argc, char **argv) features.count = systemInfo.dwNumberOfProcessors; features.x64 = true; #endif + + //Hack to disable x64 on the Windows 8 Developer Preview + osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + if(features.x64 && GetVersionEx(&osVersionInfo)) + { + if((osVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osVersionInfo.dwMajorVersion == 6) && (osVersionInfo.dwMinorVersion == 2)) + { + qWarning("Windows 8 (x64) detected. Going to disable all x64 support for now!\n"); + features.x64 = false; + } + } if(argv) { + bool flag = false; for(int i = 0; i < argc; i++) { - if(!_stricmp("--force-cpu-no-64bit", argv[i])) features.x64 = false; - if(!_stricmp("--force-cpu-no-sse", argv[i])) features.sse = features.sse2 = features.sse3 = features.ssse3 = false; - if(!_stricmp("--force-cpu-no-intel", argv[i])) features.intel = false; + if(!_stricmp("--force-cpu-no-64bit", argv[i])) { flag = true; features.x64 = false; } + if(!_stricmp("--force-cpu-no-sse", argv[i])) { flag = true; features.sse = features.sse2 = features.sse3 = features.ssse3 = false; } + if(!_stricmp("--force-cpu-no-intel", argv[i])) { flag = true; features.intel = false; } } + if(flag) qWarning("CPU flags overwritten by user-defined parameters. Take care!\n"); } return features;