1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

CMake: Sync tuklib_cpucores.cmake with tuklib_cpucores.m4.

This was forgotten from commit 2611c4d905.
This commit is contained in:
Lasse Collin 2022-10-31 11:49:47 +02:00
parent fa9efb729b
commit 1c8cbb5be3

View file

@ -89,7 +89,12 @@ function(tuklib_cpucores_internal_check)
#include <sys/sysctl.h> #include <sys/sysctl.h>
int main(void) int main(void)
{ {
#ifdef HW_NCPUONLINE
/* This is preferred on OpenBSD, see tuklib_cpucores.c. */
int name[2] = { CTL_HW, HW_NCPUONLINE };
#else
int name[2] = { CTL_HW, HW_NCPU }; int name[2] = { CTL_HW, HW_NCPU };
#endif
int cpus; int cpus;
size_t cpus_size = sizeof(cpus); size_t cpus_size = sizeof(cpus);
sysctl(name, 2, &cpus, &cpus_size, NULL, 0); sysctl(name, 2, &cpus, &cpus_size, NULL, 0);