From 35cf7c6b3c8cb68ab2dc394b7d30c2eacd438dd7 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 31 Dec 2014 11:46:04 -0800 Subject: Distinguish between IA-32 and non-x86. In case we make ws_cpuid() work on IA-32 processors, add a separate "always returns no" version of ws_cpuid() for non-x86 processors. Change-Id: Id6fbd3e5c7d4f04063bc9bcd8f1644cd617b297e Reviewed-on: https://code.wireshark.org/review/6184 Reviewed-by: Guy Harris --- wsutil/ws_cpuid.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'wsutil/ws_cpuid.h') diff --git a/wsutil/ws_cpuid.h b/wsutil/ws_cpuid.h index 676de53711..b1bd5baebc 100644 --- a/wsutil/ws_cpuid.h +++ b/wsutil/ws_cpuid.h @@ -1,5 +1,5 @@ /* ws_cpuid.h - * Get the CPU info + * Get the CPU info on x86 processors that support it * * Wireshark - Network traffic analyzer * By Gerald Combs @@ -51,14 +51,20 @@ ws_cpuid(guint32 *CPUInfo, int selector) : "a"(selector)); return 1; } -#else /* (__i386__) */ - +#elif defined(__i386__) static int ws_cpuid(guint32 *CPUInfo _U_, int selector _U_) { /* TODO: need a test if older proccesors have the cpuid instruction */ return 0; } +#elif +static int +ws_cpuid(guint32 *CPUInfo _U_, int selector _U_) +{ + /* Not x86, so no cpuid instruction */ + return 0; +} #endif #else /* Other compilers */ -- cgit v1.2.1