mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-14 16:29:16 +02:00
[BUILD] silent a warning in unlikely() with gcc 4.x
The unlikely() implementation for gcc 4.x spits out a warning
when a pointer is passed. Add a cast to unsigned long.
(cherry picked from commit 75875a7c8c)
This commit is contained in:
@@ -322,7 +322,7 @@ static inline int fls64(unsigned long long x)
|
||||
* only work with ints and booleans though.
|
||||
*/
|
||||
#define likely(x) (x)
|
||||
#define unlikely(x) (__builtin_expect((x), 0))
|
||||
#define unlikely(x) (__builtin_expect((unsigned long)(x), 0))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
* only work with ints and booleans though.
|
||||
*/
|
||||
#define likely(x) (x)
|
||||
#define unlikely(x) (__builtin_expect((x), 0))
|
||||
#define unlikely(x) (__builtin_expect((unsigned long)(x), 0))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user