|
@ -1,7 +1,9 @@ |
|
|
// offsetof() and friends |
|
|
// offsetof() and friends |
|
|
|
|
|
|
|
|
#ifndef _CL_OFFSETOF_H |
|
|
|
|
|
#define _CL_OFFSETOF_H |
|
|
|
|
|
|
|
|
// <stddef.h> in GCC 3.0/3.1 has the obscure property of redefining |
|
|
|
|
|
// offsetof every time it is included, not just the first time. |
|
|
|
|
|
// Therefore we do the same thing here, and make sure that this file |
|
|
|
|
|
// gets included after each include of <stddef.h>. |
|
|
|
|
|
|
|
|
#undef offsetof |
|
|
#undef offsetof |
|
|
#if defined(__GNUG__) |
|
|
#if defined(__GNUG__) |
|
@ -9,6 +11,10 @@ |
|
|
#else |
|
|
#else |
|
|
#define offsetof(type,ident) ((long)&(((type*)0)->ident)) |
|
|
#define offsetof(type,ident) ((long)&(((type*)0)->ident)) |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef _CL_OFFSETOF_H |
|
|
|
|
|
#define _CL_OFFSETOF_H |
|
|
|
|
|
|
|
|
#define offsetofa(type,ident) offsetof(type,ident[0]) |
|
|
#define offsetofa(type,ident) offsetof(type,ident[0]) |
|
|
|
|
|
|
|
|
#endif /* _CL_OFFSETOF_H */ |
|
|
#endif /* _CL_OFFSETOF_H */ |