From: Marco Costalba Date: Wed, 17 Mar 2010 12:22:28 +0000 (+0100) Subject: Fix __cpuid() compile error with gcc X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=a4551c59e063dfb5dc429fd70dee1ae51ea50fdd Fix __cpuid() compile error with gcc Use same __cpuid() signature used under Windows. No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/types.h b/src/types.h index d91009df..3d0305de 100644 --- a/src/types.h +++ b/src/types.h @@ -80,11 +80,14 @@ typedef uint64_t Bitboard; #elif defined(_MSC_VER) #include #elif defined(__GNUC__) -inline void __cpuid(unsigned int op, - unsigned int *eax, unsigned int *ebx, - unsigned int *ecx, unsigned int *edx) +inline void __cpuid(int CPUInfo[4], int InfoType) { - *eax = op; + int* eax = CPUInfo + 0; + int* ebx = CPUInfo + 1; + int* ecx = CPUInfo + 2; + int* edx = CPUInfo + 3; + + *eax = InfoType; *ecx = 0; __asm__("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "0" (*eax), "2" (*ecx));