From 792a5a5dd1946a327f22b2daba05c6645dfa8037 Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Fri, 30 May 2014 08:37:03 +0300 Subject: [PATCH] Small fix for __get_cpuid() --- src/strategyselector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/strategyselector.c b/src/strategyselector.c index 70c3434d..692eeebf 100644 --- a/src/strategyselector.c +++ b/src/strategyselector.c @@ -159,8 +159,9 @@ static void* strategyselector_choose_for(const strategy_list * const strategies, #if defined(__GNUC__) #include #else +#include //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}; __cpuid(CPUInfo, 0); // 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]; return 1; } + return 0; } #endif //defined(__GNUC__)