typedef struct some_struct_pointer * PTYPE; /* * Function and method declarations. * Checks mangling. */ /* No underscore, No mangling. */ extern "C" void _System ExternCVoid(void); extern "C" void * _System ExternCPVoid(void); extern "C" int _System ExternCInt(void); extern "C" PTYPE _System ExternCPType(void); /* No underscore, No mangling. */ void _System Void(void); void * _System PVoid(void); int _System Int(void); PTYPE _System PType(void); /* Members are mangled. */ class foo { public: static void _System StaticMemberVoid(void); static void * _System StaticMemberPVoid(void); static int _System StaticMemberInt(void); static PTYPE _System StaticMemberPType(void); /* VAC365 allows this too, and actually mangles the * calling convention into the name. * _System: MemberVoid__3fooF__l2_v * default: MemberVoid__3fooFv * We don't need to support this, it's just a curiosity. */ void _System MemberVoid(void); void * _System MemberPVoid(void); int _System MemberInt(void); PTYPE _System MemberPType(void); }; /* * Typedefs. * Checks that there is not warnings on these. */ typedef void _System Typedef1Void(void); typedef void * _System Typedef1PVoid(void); typedef int _System Typedef1Int(void); typedef PTYPE _System Typedef1PType(void); typedef void (_System Typedef2Void)(void); typedef void * (_System Typedef2PVoid)(void); typedef int (_System Typedef2Int)(void); typedef PTYPE (_System Typedef2PType)(void); typedef void (* _System PTypedef1Void)(void); typedef void * (* _System PTypedef1PVoid)(void); typedef int (* _System PTypedef1Int)(void); typedef PTYPE (* _System PTypedef1PType)(void); /* Alternate writing which should have the same effect I think... */ typedef void (_System * PTypedef2Void)(void); typedef void * (_System * PTypedef2PVoid)(void); typedef int (_System * PTypedef2Int)(void); typedef PTYPE (_System * PTypedef2PType)(void); /* * Structures. * Should not cause warnings. */ typedef struct VFT { void (* _System PStructMemberVoid)(void* pvThis); void * (* _System PStructMemberPVoid)(void* pvThis); int (* _System PStructMemberInt)(void* pvThis); PTYPE (* _System PStructMemberPType)(void* pvThis); /* Alternate writing which should have the same effect I think... */ void ( _System * PStructMember2Void)(void* pvThis); void * ( _System * PStructMember2PVoid)(void* pvThis); int ( _System * PStructMember2Int)(void* pvThis); PTYPE ( _System * PStructMember2PType)(void* pvThis); } VFT, *PVFT; extern "C" int DoC(void); int main(void) { ExternCVoid(); ExternCPVoid(); ExternCInt(); ExternCPType(); Void(); PVoid(); Int(); PType(); foo::StaticMemberVoid(); foo::StaticMemberPVoid(); foo::StaticMemberInt(); foo::StaticMemberPType(); foo obj; obj.MemberVoid(); obj.MemberPVoid(); obj.MemberInt(); obj.MemberPType(); VFT vft = {0,0,0,0}; if (vft.PStructMemberVoid) vft.PStructMemberVoid(&vft); if (vft.PStructMemberPVoid) vft.PStructMemberPVoid(&vft); if (vft.PStructMemberInt) vft.PStructMemberInt(&vft); if (vft.PStructMemberPType) vft.PStructMemberPType(&vft); /* test C stuff */ DoC(); /** @todo test typedefs and structure field. */ return 0; }