Fix MinGW-w64 compilation
authorJonathan Liu <net147@gmail.com>
Fri, 27 Apr 2012 10:50:08 +0000 (20:50 +1000)
committerQt by Nokia <qt-info@nokia.com>
Sun, 29 Apr 2012 23:06:47 +0000 (01:06 +0200)
Use qintptr and quintptr for exchanging data with registers for cpuid
as the size of long does not match the size of the register on Win64
which uses the LLP64 data model.

Change-Id: I23b8c8e0977166f7e62795c16e9080e44d9f25f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qsimd.cpp

index c23dc92..ac21e5b 100644 (file)
@@ -157,7 +157,7 @@ static inline uint detectProcessorFeatures()
 static int maxBasicCpuidSupported()
 {
 #if defined(Q_CC_GNU)
-    long tmp1;
+    qintptr tmp1;
 
 # ifdef Q_PROCESSOR_X86_32
     // check if the CPUID instruction is supported
@@ -198,7 +198,7 @@ static int maxBasicCpuidSupported()
 static void cpuidFeatures01(uint &ecx, uint &edx)
 {
 #if defined(Q_CC_GNU)
-    long tmp1;
+    qintptr tmp1;
     asm ("xchg " PICreg", %2\n"
          "cpuid\n"
          "xchg " PICreg", %2\n"
@@ -215,7 +215,7 @@ static void cpuidFeatures01(uint &ecx, uint &edx)
 static void cpuidFeatures07_00(uint &ebx)
 {
 #if defined(Q_CC_GNU)
-    unsigned long rbx; // in case it's 64-bit
+    quintptr rbx; // in case it's 64-bit
     asm ("xchg " PICreg", %0\n"
          "cpuid\n"
          "xchg " PICreg", %0\n"