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:
@@ -46,7 +46,8 @@ static inline unsigned int
|
|||||||
__cpu_count(cpuset_t *set)
|
__cpu_count(cpuset_t *set)
|
||||||
{
|
{
|
||||||
unsigned int count = 0;
|
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];
|
cpuset_mask mask = set->bits[i];
|
||||||
#if __GNUC__ > 2
|
#if __GNUC__ > 2
|
||||||
count += __builtin_popcount(mask);
|
count += __builtin_popcount(mask);
|
||||||
|
|||||||
Reference in New Issue
Block a user