From 4579fb3d43907b2e2373c6189437f861516acf43 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Sat, 20 Jul 2013 17:19:34 -0500 Subject: [PATCH] fixes ctaggart/mono#2 cpuid() now compiles in VS 2012 --- mono/utils/mono-hwcap-x86.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mono/utils/mono-hwcap-x86.c b/mono/utils/mono-hwcap-x86.c index c071ca46d27..57fff00039e 100644 --- a/mono/utils/mono-hwcap-x86.c +++ b/mono/utils/mono-hwcap-x86.c @@ -42,6 +42,10 @@ gboolean mono_hwcap_x86_has_sse4a = FALSE; static gboolean cpuid (int id, int *p_eax, int *p_ebx, int *p_ecx, int *p_edx) { +#if defined(_MSC_VER) + int info [4]; +#endif + /* First, make sure we can use cpuid if we're on 32-bit. */ #if defined(TARGET_X86) gboolean have_cpuid = FALSE; @@ -86,7 +90,6 @@ cpuid (int id, int *p_eax, int *p_ebx, int *p_ecx, int *p_edx) /* Now issue the actual cpuid instruction. We can use MSVC's __cpuid on both 32-bit and 64-bit. */ #if defined(_MSC_VER) - int info [4]; __cpuid (info, id); *p_eax = info [0]; *p_ebx = info [1]; -- 2.25.1