shithub: libvpx

Download patch

ref: f345da523850d0dab4c3d9e99f43978a7db467ce
parent: 520aa705cbda11faf64b311e346a42104146da8a
parent: 8caeeb886a67c8314df4f9f5abd5f55aec6b2e82
author: Paul Wilkins <[email protected]>
date: Fri Nov 22 22:05:55 EST 2013

Merge "Added cpuid compatibility for older MSVC versions"

--- a/vpx_ports/x86.h
+++ b/vpx_ports/x86.h
@@ -71,6 +71,7 @@
 #endif
 #else /* end __SUNPRO__ */
 #if ARCH_X86_64
+#if defined(_MSC_VER) && _MSC_VER > 1500
 void __cpuidex(int CPUInfo[4], int info_type, int ecxvalue);
 #pragma intrinsic(__cpuidex)
 #define cpuid(func, func2, a, b, c, d) do {\
@@ -78,6 +79,15 @@
     __cpuidex(regs, func, func2); \
     a = regs[0];  b = regs[1];  c = regs[2];  d = regs[3];\
   } while(0)
+#else
+void __cpuid(int CPUInfo[4], int info_type);
+#pragma intrinsic(__cpuid)
+#define cpuid(func, func2, a, b, c, d) do {\
+    int regs[4];\
+    __cpuid(regs, func); \
+    a = regs[0];  b = regs[1];  c = regs[2];  d = regs[3];\
+  } while (0)
+#endif
 #else
 #define cpuid(func, func2, a, b, c, d)\
   __asm mov eax, func\