offsetof already defined in stddef.h in gcc4, so add check to prevent redefinition.

(Logical change 1.658)
edge.strict_endians
void!yura 2005-01-17 11:46:32 +00:00
parent 84fccf8a8b
commit a82280f235
1 changed files with 2 additions and 0 deletions

View File

@ -49,7 +49,9 @@
/*
* Useful macro for determining the offset of a struct member.
*/
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
/*
* Simple bit operation macros. NOTE: These are NOT atomic.