From c35ea342bfc166e9d64fe16cb9d468e16a6a5f51 Mon Sep 17 00:00:00 2001 From: Anthony Tong Date: Tue, 25 Oct 2011 01:10:24 -0500 Subject: [PATCH] xfreerdp: ifdef cpuid inline asm properly --- client/X11/xfreerdp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/X11/xfreerdp.c b/client/X11/xfreerdp.c index 13af4d32e..7dc4d6573 100644 --- a/client/X11/xfreerdp.c +++ b/client/X11/xfreerdp.c @@ -677,6 +677,8 @@ boolean xf_verify_certificate(freerdp* instance, char* subject, char* issuer, ch void cpuid(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx) { +#ifdef __GNUC__ +#if defined(__i386__) || defined(__x86_64__) *eax = info; __asm volatile ("mov %%ebx, %%edi;" /* 32bit PIC: don't clobber ebx */ @@ -685,11 +687,13 @@ void cpuid(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned "mov %%edi, %%ebx;" :"+a" (*eax), "=S" (*ebx), "=c" (*ecx), "=d" (*edx) : :"edi"); +#endif +#endif } uint32 xf_detect_cpu() { - unsigned int eax, ebx, ecx, edx; + unsigned int eax, ebx, ecx, edx = 0; uint32 cpu_opt = 0; cpuid(1, &eax, &ebx, &ecx, &edx);