1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Fix __cpuid() compile error with gcc

Use same __cpuid() signature used under Windows.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-03-17 13:22:28 +01:00
parent c853b87c08
commit a4551c59e0

View file

@ -80,11 +80,14 @@ typedef uint64_t Bitboard;
#elif defined(_MSC_VER)
#include <intrin.h>
#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));