aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/ws_cpuid.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-12-31 11:46:04 -0800
committerGuy Harris <guy@alum.mit.edu>2014-12-31 19:46:33 +0000
commit35cf7c6b3c8cb68ab2dc394b7d30c2eacd438dd7 (patch)
treed5a7d940d21868ffac5f9fd47e8fd81404bba8fc /wsutil/ws_cpuid.h
parentcb7c94909173a71ca569668e0a409d2594b530de (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'wsutil/ws_cpuid.h')
-rw-r--r--wsutil/ws_cpuid.h12
1 files changed, 9 insertions, 3 deletions
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 <gerald@wireshark.org>
@@ -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 */