4 extern void (*func_ptr
)(void);
5 extern void print_var (void);
6 extern void print_foo (void);
13 void (* func_ptr
)(void);
14 int * var_with_offset
;
18 TEST xyz
= { & var
, print_var
, & var
};
20 const TEST const_xyz
= { & var
, print_var
, & var
};
27 printf ("We see var = %d\n", var
);
28 printf ("Setting var = 456\n");
33 printf ("We see var = %d\n\n", var
);
37 printf ("We see var = %d\n\n", var
);
40 printf ("We see foo = %d\n", foo
);
41 printf ("Setting foo = 19\n");
44 printf ("We see foo = %d\n\n", foo
);
47 printf ("Calling dllimported function pointer\n");
50 printf ("Calling functions using global structure\n");
55 printf ("We see var2[0] = %d\n\n", var2
[0]);
57 printf ("We see const xyz %x %x\n", const_xyz
.var
, const_xyz
.var_with_offset
);