Address compilation warning.

strategyselector.c:170:10: error: ‘__get_cpuid’ is static but used in inline function ‘get_cpuid’ which is not static [-Werror]
   return __get_cpuid(level, eax, ebx, ecx, edx);
This commit is contained in:
Ari Koivula 2014-06-17 16:26:55 +03:00
parent 60ecc6baae
commit d7abe6a7c2

View file

@ -166,13 +166,13 @@ static void* strategyselector_choose_for(const strategy_list * const strategies,
#if defined(__GNUC__) #if defined(__GNUC__)
#include <cpuid.h> #include <cpuid.h>
INLINE int get_cpuid(unsigned int level, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { static INLINE int get_cpuid(unsigned int level, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) {
return __get_cpuid(level, eax, ebx, ecx, edx); return __get_cpuid(level, eax, ebx, ecx, edx);
} }
#else #else
#include <intrin.h> #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) { static 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.