BUILD/MINOR: tools: rename popcount to my_popcountl
This is in order to avoid conflicting with NetBSD popcount* functions
since 6.x release, the final l to mentions the argument is a long like
NetBSD does.
This patch could be backported to 1.5 to fix the build issue there as well.
(cherry picked from commit e6c39416682863d1eaee3acd45ccaadf96f76b12)
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 58826f5..2a5f178 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -6130,7 +6130,7 @@
/* an explicit bind-process was specified, let's check how many
* processes remain.
*/
- nbproc = popcount(curproxy->bind_proc);
+ nbproc = my_popcountl(curproxy->bind_proc);
curproxy->bind_proc &= nbits(global.nbproc);
if (!curproxy->bind_proc && nbproc == 1) {
@@ -6155,7 +6155,7 @@
mask &= curproxy->bind_proc;
/* mask cannot be null here thanks to the previous checks */
- nbproc = popcount(bind_conf->bind_proc);
+ nbproc = my_popcountl(bind_conf->bind_proc);
bind_conf->bind_proc &= mask;
if (!bind_conf->bind_proc && nbproc == 1) {
@@ -7092,7 +7092,7 @@
mask &= bind_conf->bind_proc;
/* stop here if more than one process is used */
- if (popcount(mask) > 1)
+ if (my_popcountl(mask) > 1)
break;
}
if (&bind_conf->by_fe != &global.stats_fe->conf.bind) {
@@ -7155,7 +7155,7 @@
unsigned int next_id;
int nbproc;
- nbproc = popcount(curproxy->bind_proc & nbits(global.nbproc));
+ nbproc = my_popcountl(curproxy->bind_proc & nbits(global.nbproc));
#ifdef USE_OPENSSL
/* Configure SSL for each bind line.
@@ -7272,7 +7272,7 @@
int count, maxproc = 0;
list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) {
- count = popcount(bind_conf->bind_proc);
+ count = my_popcountl(bind_conf->bind_proc);
if (count > maxproc)
maxproc = count;
}
@@ -7421,13 +7421,13 @@
Warning("Removing incomplete section 'peers %s' (no peer named '%s').\n",
curpeers->id, localpeer);
}
- else if (popcount(curpeers->peers_fe->bind_proc) != 1) {
+ else if (my_popcountl(curpeers->peers_fe->bind_proc) != 1) {
/* either it's totally stopped or too much used */
if (curpeers->peers_fe->bind_proc) {
Alert("Peers section '%s': peers referenced by sections "
"running in different processes (%d different ones). "
"Check global.nbproc and all tables' bind-process "
- "settings.\n", curpeers->id, popcount(curpeers->peers_fe->bind_proc));
+ "settings.\n", curpeers->id, my_popcountl(curpeers->peers_fe->bind_proc));
cfgerr++;
}
stop_proxy(curpeers->peers_fe);