Small fix for __get_cpuid()

This commit is contained in:
Marko Viitanen 2014-05-30 08:37:03 +03:00
parent 642564b6fb
commit 792a5a5dd1

View file

@ -159,8 +159,9 @@ static void* strategyselector_choose_for(const strategy_list * const strategies,
#if defined(__GNUC__) #if defined(__GNUC__)
#include <cpuid.h> #include <cpuid.h>
#else #else
#include <intrin.h>
//Adapter from __cpuid (VS) to __get_cpuid (GNU C). //Adapter from __cpuid (VS) to __get_cpuid (GNU C).
inline int __get_cpuid(unsigned int __level, unsigned int *__eax, unsigned int *__ebx, unsigned int *__ecx, unsigned int *__edx) { __inline int __get_cpuid(unsigned int __level, unsigned int *__eax, unsigned int *__ebx, unsigned int *__ecx, unsigned int *__edx) {
int CPUInfo[4] = {*__eax, *__ebx, *__ecx, *__edx}; int CPUInfo[4] = {*__eax, *__ebx, *__ecx, *__edx};
__cpuid(CPUInfo, 0); __cpuid(CPUInfo, 0);
// check if the CPU supports the cpuid instruction. // check if the CPU supports the cpuid instruction.
@ -172,6 +173,7 @@ inline int __get_cpuid(unsigned int __level, unsigned int *__eax, unsigned int *
*__edx = CPUInfo[3]; *__edx = CPUInfo[3];
return 1; return 1;
} }
return 0;
} }
#endif //defined(__GNUC__) #endif //defined(__GNUC__)