5 * This definition is definitely not standard compliant, but it works
6 * surprisingly well. Also, conforming implementations are supposed
7 * to ship the <stddef.h> file.
9 #define offsetof(st, m) ((int)((char*)&((st*)(0))->m - (char*)0))
13 # define KEY '_','_','i','3','8','6'
14 #elif defined(__x86_64)
15 # define KEY '_','_','x','8','6','_','6','4'
16 #elif defined(__ppc__)
17 # define KEY '_','_','p','p','c','_','_'
18 #elif defined(__ppc64__)
19 # define KEY '_','_','p','p','c','6','4','_','_'
22 #define SIZE (offsetof(struct { char c; @type@ x; }, x))
23 char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
24 ('0' + ((SIZE / 10000)%10)),
25 ('0' + ((SIZE / 1000)%10)),
26 ('0' + ((SIZE / 100)%10)),
27 ('0' + ((SIZE / 10)%10)),
31 ' ','k','e','y','[', KEY, ']',
36 int main(argc, argv) int argc; char *argv[];
38 int main(int argc, char *argv[])
42 require += info_size[argc];