mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-22 17:41:55 +00:00
[build] Really use __builtin_offsetof() when available
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
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
Block a user