From 3d801be97d82b69ff800f939dd92d97ff012a868 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 10 Oct 2016 03:26:27 +0000 Subject: common: some FreeBSD headers are incomplete to avoid namespace pollution In file included from src/common/x64/cpu_detect.cpp:16: /usr/include/machine/cpufunc.h:66:17: error: unknown type name 'u_int' static __inline u_int ^ /usr/include/machine/cpufunc.h:67:6: error: unknown type name 'u_int' bsfl(u_int mask) ^ /usr/include/machine/cpufunc.h:69:2: error: unknown type name 'u_int' u_int result; ^ /usr/include/machine/cpufunc.h:75:17: error: unknown type name 'u_long'; did you mean 'long'? static __inline u_long ^ /usr/include/machine/cpufunc.h:76:6: error: unknown type name 'u_long'; did you mean 'long'? bsfq(u_long mask) ^ /usr/include/machine/cpufunc.h:78:2: error: use of undeclared identifier 'u_long'; did you mean 'long'? u_long result; ^ [...] --- src/common/x64/cpu_detect.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common/x64/cpu_detect.cpp') diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp index 6ddf9b70c..4abbdb96a 100644 --- a/src/common/x64/cpu_detect.cpp +++ b/src/common/x64/cpu_detect.cpp @@ -13,8 +13,10 @@ namespace Common { #ifndef _MSC_VER #ifdef __FreeBSD__ -#include +// clang-format off #include +#include +// clang-format on #endif static inline void __cpuidex(int info[4], int function_id, int subfunction_id) { -- cgit v1.2.3 From ddd8709e14ba5f954ee4855d4bb55e4b31b0c3ec Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 10 Oct 2016 16:01:55 +0000 Subject: common: use system CPUID routine on DragonFly as well --- src/common/x64/cpu_detect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/x64/cpu_detect.cpp') diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp index 4abbdb96a..370ae2c80 100644 --- a/src/common/x64/cpu_detect.cpp +++ b/src/common/x64/cpu_detect.cpp @@ -12,7 +12,7 @@ namespace Common { #ifndef _MSC_VER -#ifdef __FreeBSD__ +#if defined(__DragonFly__) || defined(__FreeBSD__) // clang-format off #include #include @@ -20,7 +20,7 @@ namespace Common { #endif static inline void __cpuidex(int info[4], int function_id, int subfunction_id) { -#ifdef __FreeBSD__ +#if defined(__DragonFly__) || defined(__FreeBSD__) // Despite the name, this is just do_cpuid() with ECX as second input. cpuid_count((u_int)function_id, (u_int)subfunction_id, (u_int*)info); #else -- cgit v1.2.3