X-Git-Url: https://ginac.de/CLN/cln.git//cln.git?a=blobdiff_plain;f=src%2Fbase%2Fcl_offsetof.h;h=89ddaf272e7657e35694ddc740e787f332b01bfd;hb=040ed6f6ed478f65442b2e0fee05c19b42c0d5e9;hp=319233448d0ff62439f4831b3d57682ed1cb677f;hpb=dd9e0f894eec7e2a8cf85078330ddc0a6639090b;p=cln.git diff --git a/src/base/cl_offsetof.h b/src/base/cl_offsetof.h index 3192334..89ddaf2 100644 --- a/src/base/cl_offsetof.h +++ b/src/base/cl_offsetof.h @@ -1,7 +1,9 @@ // offsetof() and friends -#ifndef _CL_OFFSETOF_H -#define _CL_OFFSETOF_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 . #undef offsetof #if defined(__GNUG__) @@ -9,6 +11,10 @@ #else #define offsetof(type,ident) ((long)&(((type*)0)->ident)) #endif + +#ifndef _CL_OFFSETOF_H +#define _CL_OFFSETOF_H + #define offsetofa(type,ident) offsetof(type,ident[0]) #endif /* _CL_OFFSETOF_H */