]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Clean up x86.c a bit
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 3 Nov 2015 12:06:44 +0000 (13:06 +0100)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 3 Nov 2015 12:06:44 +0000 (13:06 +0100)
arch/x86/x86.c

index 57af918cca136f0e005cfa3632108a85f2627c93..c932627f163fb617b8576914e8049c2dd2bc0e1c 100644 (file)
@@ -16,9 +16,13 @@ ZLIB_INTERNAL int x86_cpu_has_pclmulqdq;
 
 #ifdef _MSC_VER
 #include <intrin.h>
-#define CPU_PROCINFO_AND_FEATUREBITS 1
+#else
+// Newer versions of GCC and clang come with cpuid.h
+#include <cpuid.h>
+#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 <cpuid.h>
-
-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;