[build] Really use __builtin_offsetof() when available

Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/1/head
Arkadiusz Miskiewicz 2010-11-28 18:28:15 +00:00 committed by Michael Brown
parent 795793b3a4
commit 719f2d793c
1 changed files with 2 additions and 2 deletions

View File

@ -10,8 +10,8 @@ FILE_LICENCE ( GPL2_ONLY );
#define NULL ((void *)0) #define NULL ((void *)0)
#undef offsetof #undef offsetof
#ifdef __compiler_offsetof #if ( defined ( __GNUC__ ) && ( __GNUC__ > 3 ) )
#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
#else #else
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif #endif