Remove non-portable and unnused header includes
[ardour.git] / libs / pbd / cpus.cc
index ba4ba32fe4d10acbfb2767533acab2eee1c55722..48b919cd966fb55b7da9eaad7c061b15930bba16 100644 (file)
@@ -25,6 +25,7 @@
 #ifdef __linux__
 #include <unistd.h>
 #elif defined(__APPLE__) || defined(__FreeBSD__)
+#include <stddef.h>
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #endif
@@ -39,7 +40,7 @@ hardware_concurrency()
 #elif defined(__APPLE__) || defined(__FreeBSD__)
         int count;
         size_t size=sizeof(count);
-        return sysctlbyname("hw.ncpu",&count,&size,NULL,0)?0:count;
+        return sysctlbyname("hw.physicalcpu",&count,&size,NULL,0)?0:count;
 #elif defined(HAVE_UNISTD) && defined(_SC_NPROCESSORS_ONLN)
         int const count=sysconf(_SC_NPROCESSORS_ONLN);
         return (count>0)?count:0;