gnu/sched.h: fix CPU_COUNT on gcc2 C89

Change-Id: Ia193e342d2bbac8060189f062e35aca47426444e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9626
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Jérôme Duval
2025-09-03 15:10:23 +00:00
parent b54f586058
commit 0937305b84
+2 -1
View File
@@ -46,7 +46,8 @@ static inline unsigned int
__cpu_count(cpuset_t *set)
{
unsigned int count = 0;
for (unsigned int i = 0; i < _howmany(CPU_SETSIZE, NCPUSETBITS); i++) {
unsigned int i;
for (i = 0; i < _howmany(CPU_SETSIZE, NCPUSETBITS); i++) {
cpuset_mask mask = set->bits[i];
#if __GNUC__ > 2
count += __builtin_popcount(mask);