0159-typedef.c - scc - simple c99 compiler
HTML git clone git://git.simple-cc.org/scc
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
0159-typedef.c (341B)
---
1 /* Taken from plan9 kernel */
2
3 typedef struct Clock0link Clock0link;
4 typedef struct Clock0link {
5 int (*clock)(void);
6 Clock0link* link;
7 };
8
9 #if __STDC_VERSION__ >= 201112L
10 typedef struct Clock0link Clock0link;
11 #endif
12
13 int
14 f(void)
15 {
16 return 0;
17 }
18
19 Clock0link cl0 = {
20 .clock = f
21 };
22
23 int
24 main(void)
25 {
26 return (*cl0.clock)();
27 }