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>
Fri, 3 Sep 2021 14:28:58 +0000 (16:28 +0200)
commit84ae6a917f44d8c7470c1d650d8a077eeb68166f
treed7f99bae5f8bd2ac956791081aaf033afacc0548
parentabb55055a65b952e230c38aae4006ca252d3d934
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.

(cherry picked from commit cbdc74b4b32af93b4724adcb4b2354bb811693ab)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit d822d9ae2cbc8e713c40c0f7b9e0f2f2225a606d)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/import/eb64tree.h