QThread:idealThreadCount: fix build with FreeBSD 13.1

They added the CPU_COUNT_S macro.

Pick-to: 6.4
Change-Id: I6d3880c7d99d4fc494c8fffd16fabe9f8226ecda
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Thiago Macieira 2022-06-21 14:03:25 -07:00
parent cb0b1ee441
commit 45de3fedba

View File

@ -413,7 +413,7 @@ int QThread::idealThreadCount() noexcept
cores = (int)psd.psd_proc_cnt;
}
#elif (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) || defined(Q_OS_FREEBSD)
# ifdef Q_OS_FREEBSD
# if defined(Q_OS_FREEBSD) && !defined(CPU_COUNT_S)
# define CPU_COUNT_S(setsize, cpusetp) ((int)BIT_COUNT(setsize, cpusetp))
// match the Linux API for simplicity
using cpu_set_t = cpuset_t;