X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fcpu.cc;h=c62d6c25e0fc6ddb052cfd0310433682dc421d56;hb=7fa883aca713b99985cf35750ab0e2ffe6ce58e0;hp=838804d7fc3a29b10de248deaaca0fe75ce390bc;hpb=97b73d47e6a3d5729ba13304ff355a737a34f1b4;p=awesomized%2Flibmemcached diff --git a/libtest/cpu.cc b/libtest/cpu.cc index 838804d7..c62d6c25 100644 --- a/libtest/cpu.cc +++ b/libtest/cpu.cc @@ -41,7 +41,9 @@ #pragma GCC diagnostic ignored "-Wundef" -#if defined(HAVE_SYS_SYSCTL_H) && HAVE_SYS_SYSCTL_H +#if defined(HAVE_LINUX_SYSCTL_H) && HAVE_LINUX_SYSCTL_H +#include +#elif defined(HAVE_SYS_SYSCTL_H) && HAVE_SYS_SYSCTL_H #include #endif @@ -50,7 +52,7 @@ namespace libtest { size_t number_of_cpus() { size_t number_of_cpu= 1; -#if defined(TARGET_OS_LINUX) && TARGET_OS_LINUX +#if defined(__linux) && __linux number_of_cpu= sysconf(_SC_NPROCESSORS_ONLN); #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && defined(HW_NCPU) && defined(HW_AVAILCPU) && defined(HW_NCPU) int mib[4];