From: Willy Tarreau Date: Sat, 12 Aug 2023 17:01:10 +0000 (+0200) Subject: BUILD: defaults: use __WORDSIZE not LONGBITS for MAX_THREADS_PER_GROUP X-Git-Tag: v2.9-dev3~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59c347c15e909cac33e451543ca7cd68abac670e;p=thirdparty%2Fhaproxy.git BUILD: defaults: use __WORDSIZE not LONGBITS for MAX_THREADS_PER_GROUP 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). --- diff --git a/include/haproxy/defaults.h b/include/haproxy/defaults.h index 03c4d2c226..898ebd15bc 100644 --- a/include/haproxy/defaults.h +++ b/include/haproxy/defaults.h @@ -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.