BUG/MINOR: compat: make sure __WORDSIZE is always defined
authorWilly Tarreau <w@1wt.eu>
Wed, 15 Sep 2021 08:15:03 +0000 (10:15 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 20 Sep 2021 14:51:14 +0000 (16:51 +0200)
commit0df18182b87f49bbc1fc77a561b74dd8d42fd8c4
tree2db4a8450634a23c41720db2387918d4331aea9b
parentdecd638a8c99cb6c4285e13085d183b64afe37db
BUG/MINOR: compat: make sure __WORDSIZE is always defined

-Wundef triggered on a MIPS-based musl build on __WORDSIZE that's used
in ultoa_o() and some Lua initialization. The former will fail to convert
integers larger to 1 billion to proper string in this case. Let's make
sure this macro is defined and fall back to values determined from
__SIZEOF_LONG__ otherwise. A cleaner long-term approach would consist
in removing all remaining occurrences of this macro.

This can be backported to all versions.

(cherry picked from commit 4f5485bfad8355b7cf2d62a36897558dfc44bcb6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 3f41b89598ed8978ee878d35b98a5c0e997c3b05)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/compat.h