From: Hans Kristian Rosbach Date: Tue, 3 Nov 2015 12:06:44 +0000 (+0100) Subject: Clean up x86.c a bit X-Git-Tag: 1.9.9-b1~793^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d40706527ef0f2cb2ff3f3e512ae820734f2065e;p=thirdparty%2Fzlib-ng.git Clean up x86.c a bit --- diff --git a/arch/x86/x86.c b/arch/x86/x86.c index 57af918cc..c932627f1 100644 --- a/arch/x86/x86.c +++ b/arch/x86/x86.c @@ -16,9 +16,13 @@ ZLIB_INTERNAL int x86_cpu_has_pclmulqdq; #ifdef _MSC_VER #include -#define CPU_PROCINFO_AND_FEATUREBITS 1 +#else +// Newer versions of GCC and clang come with cpuid.h +#include +#endif static void cpuid(int info, unsigned* eax, unsigned* ebx, unsigned* ecx, unsigned* edx) { +#ifdef _MSC_VER unsigned int registers[4]; __cpuid(registers, info); @@ -26,12 +30,7 @@ static void cpuid(int info, unsigned* eax, unsigned* ebx, unsigned* ecx, unsigne *ebx = registers[1]; *ecx = registers[2]; *edx = registers[3]; -} #else -// Newer versions of GCC and clang come with cpuid.h -#include - -static void cpuid(int info, unsigned* eax, unsigned* ebx, unsigned* ecx, unsigned* edx) { unsigned int _eax; unsigned int _ebx; unsigned int _ecx; @@ -41,8 +40,8 @@ static void cpuid(int info, unsigned* eax, unsigned* ebx, unsigned* ecx, unsigne *ebx = _ebx; *ecx = _ecx; *edx = _edx; -} #endif +} void ZLIB_INTERNAL x86_check_features(void) { unsigned eax, ebx, ecx, edx;