Compile fix: Do not rely on __cpuidex() for msvc2008
Since its hard to detect if __cpuidex() is actually available at compile time, we'll add a function overload that will be chosen if the intrinsic __cpuidex() is not available. Note that the QtXgetbvHack that was used for _xgetbv did not really work (MS compiler will bail out because of ambiguous overloads if the intrinsic _xgetbv existed). Therefore, we apply the same workaround for _xgetbv. Change-Id: Iee3bf8bc6352ba0861b05d779f1f001d4eb013ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
c01621ec88
commit
55d7e5f18b
@ -212,6 +212,10 @@ static void cpuidFeatures01(uint &ecx, uint &edx)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
inline void __cpuidex(int info[4], int, __int64) { memset(info, 0, 4*sizeof(int));}
|
||||
#endif
|
||||
|
||||
static void cpuidFeatures07_00(uint &ebx)
|
||||
{
|
||||
#if defined(Q_CC_GNU)
|
||||
@ -231,10 +235,7 @@ static void cpuidFeatures07_00(uint &ebx)
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
namespace QtXgetbvHack {
|
||||
inline quint64 _xgetbv(int) { return 0; }
|
||||
}
|
||||
using namespace QtXgetbvHack;
|
||||
inline quint64 _xgetbv(__int64) { return 0; }
|
||||
#endif
|
||||
|
||||
static void xgetbv(int in, uint &eax, uint &edx)
|
||||
|
Loading…
Reference in New Issue
Block a user