BUG/MINOR: ebtree: remove dependency on incorrect macro for bits per long
authorWilly Tarreau <w@1wt.eu>
Sat, 28 Aug 2021 09:55:53 +0000 (11:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 28 Aug 2021 09:55:53 +0000 (11:55 +0200)
commitcbdc74b4b32af93b4724adcb4b2354bb811693ab
treed960fec0ea1fbfcac3e065a02468e8f546ac698e
parentfe456c581f521dedb68a18c49f17f981f75a943b
BUG/MINOR: ebtree: remove dependency on incorrect macro for bits per long

The code used to rely on BITS_PER_LONG to decide on the most efficient
way to perform a 64-bit shift, but this macro is not defined (at best
it's __BITS_PER_LONG) and it's likely that it's been like this since
the early implementation of ebtrees designed on i386. Let's remove the
test on this macro and rely on sizeof(long) instead, it also has the
benefit of letting the compiler validate the two branches.

This can be backported to all versions. Thanks to Ezequiel Garcia for
reporting this one in issue #1369.
include/import/eb64tree.h