From 186a608d2c55690dce5494fc159ec6022c923dd9 Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Sun, 24 Sep 2006 16:35:01 +0000 Subject: [PATCH] Added __cpuid function for MSVC6 --- goldlib/gall/gutlvers.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/goldlib/gall/gutlvers.cpp b/goldlib/gall/gutlvers.cpp index 3e2cf24..49c0833 100644 --- a/goldlib/gall/gutlvers.cpp +++ b/goldlib/gall/gutlvers.cpp @@ -31,7 +31,9 @@ #if defined(__WIN32__) #include +#if defined(_MSC_VER) && (_MSC_VER > 1200) #include +#endif #elif defined(__GNUC__) #include #endif @@ -48,6 +50,26 @@ #define _MAX_MNAME_LEN 30 +// ------------------------------------------------------------------ + +#if defined(_MSC_VER) && (_MSC_VER <= 1200) +static void __cpuid(int CPUInfo[4], int cpuidfun) +{ + __asm + { + mov eax, cpuidfun + cpuid + + mov esi, CPUInfo + mov [esi + 0], eax + mov [esi + 4], ebx + mov [esi + 8], ecx + mov [esi + 12], edx + } +} +#endif + + // ------------------------------------------------------------------ inline static bool HaveCPUID()