]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: defaults: use __WORDSIZE not LONGBITS for MAX_THREADS_PER_GROUP
authorWilly Tarreau <w@1wt.eu>
Sat, 12 Aug 2023 17:01:10 +0000 (19:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 Aug 2023 17:04:34 +0000 (19:04 +0200)
LONGBITS was defined long ago with old compilers that didn't provide the
word size. It's still present as being referenced in various places in the
code, but we must not use it to define other macros that may be evaluated
at pre-processing time since it contains sizeof() and casts that are not
compatible with preprocessor conditions. Let's switch MAX_THREADS_PER_GROUP
to __WORDSIZE so that we can condition blocks of code on it if needed.

LONGBITS should really be removed by now, given that we don't support
compilers not providing __WORDSIZE anymore (gcc < 4.2).

include/haproxy/defaults.h

index 03c4d2c2261141cf9a51afa2335b79d060feafa2..898ebd15bcbf64f681d518750391f493144565c9 100644 (file)
@@ -45,7 +45,7 @@
 #define MAX_TGROUPS 16
 #endif
 
-#define MAX_THREADS_PER_GROUP LONGBITS
+#define MAX_THREADS_PER_GROUP __WORDSIZE
 
 /* threads enabled, max_threads defaults to long bits for 1 tgroup or 4 times
  * long bits if more tgroups are enabled.