Get rid of ambiguous overload for xgetbv.
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Mon, 21 May 2012 08:51:18 +0000 (10:51 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 21 May 2012 10:54:48 +0000 (12:54 +0200)
The patch that broke this was assuming the signature of xgetbv was
_xgetbv(int). This lead to that there were no exact match for the
function resolver, thus the ambiguity.

Apparently, the signature of _xgetbv is _xgetbv(unsigned int).
Changing the static xgetbv to uint makes the match exact, thus no more
ambiguity.

Change-Id: I8db95e00a9fef264d7a1f84d02bb929db84e6e5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
src/corelib/tools/qsimd.cpp

index 821de8d..dacff0f 100644 (file)
@@ -235,10 +235,10 @@ static void cpuidFeatures07_00(uint &ebx)
 }
 
 #ifdef Q_OS_WIN
+// fallback overload in case this intrinsic does not exist: unsigned __int64 _xgetbv(unsigned int);
 inline quint64 _xgetbv(__int64) { return 0; }
 #endif
-
-static void xgetbv(int in, uint &eax, uint &edx)
+static void xgetbv(uint in, uint &eax, uint &edx)
 {
 #ifdef Q_OS_WIN
     quint64 result = _xgetbv(in);