utils: rename popcount to avoid conflict in NetBSD

Resolves https://github.com/xkbcommon/libxkbcommon/issues/41
Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2016-11-14 17:37:35 +02:00
parent d596f6e3ff
commit 327364d277
2 changed files with 3 additions and 2 deletions

View File

@ -1359,7 +1359,7 @@ key_get_consumed(struct xkb_state *state, const struct xkb_key *key,
if (XkbLevelsSameSyms(level, no_mods_level)) if (XkbLevelsSameSyms(level, no_mods_level))
continue; continue;
if (entry == matching_entry || popcount(entry->mods.mask) == 1) if (entry == matching_entry || my_popcount(entry->mods.mask) == 1)
consumed |= entry->mods.mask & ~entry->preserve.mask; consumed |= entry->mods.mask & ~entry->preserve.mask;
} }
break; break;

View File

@ -178,8 +178,9 @@ msb_pos(uint32_t mask)
return pos; return pos;
} }
// Avoid conflict with other popcount()s.
static inline int static inline int
popcount(uint32_t x) my_popcount(uint32_t x)
{ {
int count; int count;
#if defined(HAVE___BUILTIN_POPCOUNT) #if defined(HAVE___BUILTIN_POPCOUNT)