mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 14:21:00 +01:00
BUILD/MINOR: compiler: fix offsetof() on older compilers
An offsetof() macro was introduced with commit 928fbfa ("MINOR: compiler:
introduce offsetoff().") with a fallback for older compilers. But this
breaks gcc 3.4 because __size_t and __uintptr_t are not defined there.
However size_t and uintptr_t are, so let's fix it this way. No backport
needed.
This commit is contained in:
parent
7fec021537
commit
c03ea40763
@ -121,7 +121,7 @@
|
|||||||
#define offsetof(type, field) __builtin_offsetof(type, field)
|
#define offsetof(type, field) __builtin_offsetof(type, field)
|
||||||
#else
|
#else
|
||||||
#define offsetof(type, field) \
|
#define offsetof(type, field) \
|
||||||
((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field))
|
((size_t)(uintptr_t)((const volatile void *)&((type *)0)->field))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user