Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[build] Really use __builtin_offsetof() when available
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
arekm authored and mcb30 committed Nov 28, 2010
1 parent 795793b commit 719f2d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/include/stddef.h
Expand Up @@ -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
Expand Down

0 comments on commit 719f2d7

Please sign in to comment.