1 | typedef struct some_struct_pointer * PTYPE;
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Function and method declarations.
|
---|
5 | * Checks mangling.
|
---|
6 | */
|
---|
7 | /* No underscore, No mangling. */
|
---|
8 | void _System Void(void);
|
---|
9 | void * _System PVoid(void);
|
---|
10 | int _System Int(void);
|
---|
11 | PTYPE _System PType(void);
|
---|
12 |
|
---|
13 | /*
|
---|
14 | * Typedefs.
|
---|
15 | * Checks that there is not warnings on these.
|
---|
16 | */
|
---|
17 | typedef void _System Typedef1Void(void);
|
---|
18 | typedef void * _System Typedef1PVoid(void);
|
---|
19 | typedef int _System Typedef1Int(void);
|
---|
20 | typedef PTYPE _System Typedef1PType(void);
|
---|
21 |
|
---|
22 | typedef void (_System Typedef2Void)(void);
|
---|
23 | typedef void * (_System Typedef2PVoid)(void);
|
---|
24 | typedef int (_System Typedef2Int)(void);
|
---|
25 | typedef PTYPE (_System Typedef2PType)(void);
|
---|
26 |
|
---|
27 | typedef void (* _System PTypedef1Void)(void);
|
---|
28 | typedef void * (* _System PTypedef1PVoid)(void);
|
---|
29 | typedef int (* _System PTypedef1Int)(void);
|
---|
30 | typedef PTYPE (* _System PTypedef1PType)(void);
|
---|
31 |
|
---|
32 | typedef void (_System * PTypedef2Void)(void);
|
---|
33 | typedef void * (_System * PTypedef2PVoid)(void);
|
---|
34 | typedef int (_System * PTypedef2Int)(void);
|
---|
35 | typedef PTYPE (_System * PTypedef2PType)(void);
|
---|
36 |
|
---|
37 |
|
---|
38 | /*
|
---|
39 | * Structures.
|
---|
40 | */
|
---|
41 | typedef struct VFT
|
---|
42 | {
|
---|
43 | void (_System * PStructMemberVoid)(void* pvThis);
|
---|
44 | void * (_System * PStructMemberPVoid)(void* pvThis);
|
---|
45 | int (_System * PStructMemberInt)(void* pvThis);
|
---|
46 | PTYPE (_System * PStructMemberPType)(void* pvThis);
|
---|
47 | } VFT, *PVFT;
|
---|
48 |
|
---|
49 |
|
---|
50 | int DoC(void)
|
---|
51 | {
|
---|
52 | VFT vft = {0,0,0,0};
|
---|
53 |
|
---|
54 | Void();
|
---|
55 | PVoid();
|
---|
56 | Int();
|
---|
57 | PType();
|
---|
58 |
|
---|
59 | if (vft.PStructMemberVoid)
|
---|
60 | vft.PStructMemberVoid(&vft);
|
---|
61 | if (vft.PStructMemberPVoid)
|
---|
62 | vft.PStructMemberPVoid(&vft);
|
---|
63 | if (vft.PStructMemberInt)
|
---|
64 | vft.PStructMemberInt(&vft);
|
---|
65 | if (vft.PStructMemberPType)
|
---|
66 | vft.PStructMemberPType(&vft);
|
---|
67 |
|
---|
68 | return 0;
|
---|
69 | }
|
---|
70 |
|
---|