mirror of https://github.com/ipxe/ipxe.git
[build] Really use __builtin_offsetof() when available
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/1/head
parent
795793b3a4
commit
719f2d793c
|
@ -10,8 +10,8 @@ FILE_LICENCE ( GPL2_ONLY );
|
|||
#define NULL ((void *)0)
|
||||
|
||||
#undef offsetof
|
||||
#ifdef __compiler_offsetof
|
||||
#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
|
||||
#if ( defined ( __GNUC__ ) && ( __GNUC__ > 3 ) )
|
||||
#define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
|
||||
#else
|
||||
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue