]> www.ginac.de Git - cln.git/blob - src/base/cl_offsetof.h
* Adjusted dates and final touches for 1.1.1.
[cln.git] / src / base / cl_offsetof.h
1 // offsetof() and friends
2
3 #ifndef _CL_OFFSETOF_H
4 #define _CL_OFFSETOF_H
5
6 #undef offsetof
7 #if defined(__GNUG__)
8   #define offsetof(type,ident)  ((long)&(((type*)1)->ident)-1)
9 #else
10   #define offsetof(type,ident)  ((long)&(((type*)0)->ident))
11 #endif
12 #define offsetofa(type,ident)  offsetof(type,ident[0])
13
14 #endif /* _CL_OFFSETOF_H */