Changeset 599 for trunk/testcase/570main.cpp
- Timestamp:
- Aug 15, 2003, 11:49:10 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/testcase/570main.cpp
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r598 r599 7 7 8 8 /* No underscore, No mangling. */ 9 extern "C" void _System ExternCVoid( void);10 extern "C" void * _System ExternCPVoid( void);11 extern "C" int _System ExternCInt( void);12 extern "C" PTYPE _System ExternCPType( void);9 extern "C" void _System ExternCVoid(int a, int b, int c, int d); 10 extern "C" void * _System ExternCPVoid(int a, int b, int c, int d); 11 extern "C" int _System ExternCInt(int a, int b, int c, int d); 12 extern "C" PTYPE _System ExternCPType(int a, int b, int c, int d); 13 13 14 14 /* No underscore, No mangling. */ 15 void _System Void( void);16 void * _System PVoid( void);17 int _System Int( void);18 PTYPE _System PType( void);15 void _System Void(int a, int b, int c, int d); 16 void * _System PVoid(int a, int b, int c, int d); 17 int _System Int(int a, int b, int c, int d); 18 PTYPE _System PType(int a, int b, int c, int d); 19 19 20 20 … … 23 23 { 24 24 public: 25 static void _System StaticMemberVoid( void);26 static void * _System StaticMemberPVoid( void);27 static int _System StaticMemberInt( void);28 static PTYPE _System StaticMemberPType( void);25 static void _System StaticMemberVoid(int a, int b, int c, int d); 26 static void * _System StaticMemberPVoid(int a, int b, int c, int d); 27 static int _System StaticMemberInt(int a, int b, int c, int d); 28 static PTYPE _System StaticMemberPType(int a, int b, int c, int d); 29 29 30 30 /* VAC365 allows this too, and actually mangles the … … 34 34 * We don't need to support this, it's just a curiosity. 35 35 */ 36 void _System MemberVoid( void);37 void * _System MemberPVoid( void);38 int _System MemberInt( void);39 PTYPE _System MemberPType( void);36 void _System MemberVoid(int a, int b, int c, int d); 37 void * _System MemberPVoid(int a, int b, int c, int d); 38 int _System MemberInt(int a, int b, int c, int d); 39 PTYPE _System MemberPType(int a, int b, int c, int d); 40 40 }; 41 41 … … 45 45 * Checks that there is not warnings on these. 46 46 */ 47 typedef void _System Typedef1Void( void);48 typedef void * _System Typedef1PVoid( void);49 typedef int _System Typedef1Int( void);50 typedef PTYPE _System Typedef1PType( void);47 typedef void _System Typedef1Void(int a, int b, int c, int d); 48 typedef void * _System Typedef1PVoid(int a, int b, int c, int d); 49 typedef int _System Typedef1Int(int a, int b, int c, int d); 50 typedef PTYPE _System Typedef1PType(int a, int b, int c, int d); 51 51 52 typedef void (_System Typedef2Void)( void);53 typedef void * (_System Typedef2PVoid)( void);54 typedef int (_System Typedef2Int)( void);55 typedef PTYPE (_System Typedef2PType)( void);52 typedef void (_System Typedef2Void)(int a, int b, int c, int d); 53 typedef void * (_System Typedef2PVoid)(int a, int b, int c, int d); 54 typedef int (_System Typedef2Int)(int a, int b, int c, int d); 55 typedef PTYPE (_System Typedef2PType)(int a, int b, int c, int d); 56 56 57 typedef void (* _System PTypedef1Void)( void);58 typedef void * (* _System PTypedef1PVoid)( void);59 typedef int (* _System PTypedef1Int)( void);60 typedef PTYPE (* _System PTypedef1PType)( void);57 typedef void (* _System PTypedef1Void)(int a, int b, int c, int d); 58 typedef void * (* _System PTypedef1PVoid)(int a, int b, int c, int d); 59 typedef int (* _System PTypedef1Int)(int a, int b, int c, int d); 60 typedef PTYPE (* _System PTypedef1PType)(int a, int b, int c, int d); 61 61 62 62 /* Alternate writing which should have the same effect I think... */ 63 typedef void (_System * PTypedef2Void)( void);64 typedef void * (_System * PTypedef2PVoid)( void);65 typedef int (_System * PTypedef2Int)( void);66 typedef PTYPE (_System * PTypedef2PType)( void);63 typedef void (_System * PTypedef2Void)(int a, int b, int c, int d); 64 typedef void * (_System * PTypedef2PVoid)(int a, int b, int c, int d); 65 typedef int (_System * PTypedef2Int)(int a, int b, int c, int d); 66 typedef PTYPE (_System * PTypedef2PType)(int a, int b, int c, int d); 67 67 68 68 … … 73 73 typedef struct VFT 74 74 { 75 void (* _System PStructMemberVoid)( void* pvThis);76 void * (* _System PStructMemberPVoid)( void* pvThis);77 int (* _System PStructMemberInt)( void* pvThis);78 PTYPE (* _System PStructMemberPType)( void* pvThis);75 void (* _System PStructMemberVoid)(int a, int b, int c, int d); 76 void * (* _System PStructMemberPVoid)(int a, int b, int c, int d); 77 int (* _System PStructMemberInt)(int a, int b, int c, int d); 78 PTYPE (* _System PStructMemberPType)(int a, int b, int c, int d); 79 79 80 80 /* Alternate writing which should have the same effect I think... */ 81 void ( _System * PStructMember2Void)( void* pvThis);82 void * ( _System * PStructMember2PVoid)( void* pvThis);83 int ( _System * PStructMember2Int)( void* pvThis);84 PTYPE ( _System * PStructMember2PType)( void* pvThis);81 void ( _System * PStructMember2Void)(int a, int b, int c, int d); 82 void * ( _System * PStructMember2PVoid)(int a, int b, int c, int d); 83 int ( _System * PStructMember2Int)(int a, int b, int c, int d); 84 PTYPE ( _System * PStructMember2PType)(int a, int b, int c, int d); 85 85 86 86 } VFT, *PVFT; … … 90 90 int main(void) 91 91 { 92 ExternCVoid(); 93 ExternCPVoid(); 94 ExternCInt(); 95 ExternCPType(); 92 VFT vft = {Void, PVoid, Int, PType, 93 Void, PVoid, Int, PType}; 96 94 97 Void();98 PVoid();99 Int();100 PType();95 Typedef1Void * pfnTypedef1Void = Void; 96 Typedef1PVoid * pfnTypedef1PVoid = PVoid; 97 Typedef1Int * pfnTypedef1Int = Int; 98 Typedef1PType * pfnTypedef1PType = PType; 101 99 102 foo::StaticMemberVoid(); 103 foo::StaticMemberPVoid(); 104 foo::StaticMemberInt(); 105 foo::StaticMemberPType(); 100 Typedef2Void * pfnTypedef2Void = Void; 101 Typedef2PVoid * pfnTypedef2PVoid = PVoid; 102 Typedef2Int * pfnTypedef2Int = Int; 103 Typedef2PType * pfnTypedef2PType = PType; 104 105 PTypedef1Void pfnPTypedef1Void = Void; 106 PTypedef1PVoid pfnPTypedef1PVoid = PVoid; 107 PTypedef1Int pfnPTypedef1Int = Int; 108 PTypedef1PType pfnPTypedef1PType = PType; 109 110 PTypedef2Void pfnPTypedef2Void = Void; 111 PTypedef2PVoid pfnPTypedef2PVoid = PVoid; 112 PTypedef2Int pfnPTypedef2Int = Int; 113 PTypedef2PType pfnPTypedef2PType = PType; 114 115 /* extern functions */ 116 ExternCVoid(1,2,3,4); 117 ExternCPVoid(1,2,3,4); 118 ExternCInt(1,2,3,4); 119 ExternCPType(1,2,3,4); 120 121 Void(1,2,3,4); 122 PVoid(1,2,3,4); 123 Int(1,2,3,4); 124 PType(1,2,3,4); 125 126 /* class */ 127 foo::StaticMemberVoid(1,2,3,4); 128 foo::StaticMemberPVoid(1,2,3,4); 129 foo::StaticMemberInt(1,2,3,4); 130 foo::StaticMemberPType(1,2,3,4); 106 131 107 132 foo obj; 108 obj.MemberVoid( );109 obj.MemberPVoid( );110 obj.MemberInt( );111 obj.MemberPType( );133 obj.MemberVoid(1,2,3,4); 134 obj.MemberPVoid(1,2,3,4); 135 obj.MemberInt(1,2,3,4); 136 obj.MemberPType(1,2,3,4); 112 137 113 VFT vft = {0,0,0,0}; 114 if (vft.PStructMemberVoid) 115 vft.PStructMemberVoid(&vft); 116 if (vft.PStructMemberPVoid) 117 vft.PStructMemberPVoid(&vft); 118 if (vft.PStructMemberInt) 119 vft.PStructMemberInt(&vft); 120 if (vft.PStructMemberPType) 121 vft.PStructMemberPType(&vft); 138 /* typedefs */ 139 pfnTypedef1Void(1,2,3,4); 140 pfnTypedef1PVoid(1,2,3,4); 141 pfnTypedef1Int(1,2,3,4); 142 pfnTypedef1PType(1,2,3,4); 143 144 pfnTypedef2Void(1,2,3,4); 145 pfnTypedef2PVoid(1,2,3,4); 146 pfnTypedef2Int(1,2,3,4); 147 pfnTypedef2PType(1,2,3,4); 148 149 pfnPTypedef1Void(1,2,3,4); 150 pfnPTypedef1PVoid(1,2,3,4); 151 pfnPTypedef1Int(1,2,3,4); 152 pfnPTypedef1PType(1,2,3,4); 153 154 pfnPTypedef2Void(1,2,3,4); 155 pfnPTypedef2PVoid(1,2,3,4); 156 pfnPTypedef2Int(1,2,3,4); 157 pfnPTypedef2PType(1,2,3,4); 158 159 160 /* structs */ 161 vft.PStructMemberVoid(1,2,3,4); 162 vft.PStructMemberPVoid(1,2,3,4); 163 vft.PStructMemberInt(1,2,3,4); 164 vft.PStructMemberPType(1,2,3,4); 165 166 vft.PStructMember2Void(1,2,3,4); 167 vft.PStructMember2PVoid(1,2,3,4); 168 vft.PStructMember2Int(1,2,3,4); 169 vft.PStructMember2PType(1,2,3,4); 122 170 123 171 /* test C stuff */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.