Also normalize reference type as well as pointer type.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4326 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cb107801fb
commit
c3d9424ca3
1 changed files with 23 additions and 1 deletions
|
|
@ -285,6 +285,25 @@ public:
|
|||
return SwigType_ispointer(SwigType_typedef_resolve_all(t));
|
||||
}
|
||||
|
||||
void oc_SwigType_del_reference(SwigType *t) {
|
||||
char *c = Char(t);
|
||||
if (strncmp(c,"q(",2) == 0) {
|
||||
Delete(SwigType_pop(t));
|
||||
c = Char(t);
|
||||
}
|
||||
if (strncmp(c,"r.",2)) {
|
||||
printf("Fatal error. SwigType_del_pointer applied to non-pointer.\n");
|
||||
abort();
|
||||
}
|
||||
Replace(t,"r.","", DOH_REPLACE_ANY | DOH_REPLACE_FIRST);
|
||||
}
|
||||
|
||||
int
|
||||
is_a_reference (SwigType *t)
|
||||
{
|
||||
return SwigType_isreference(SwigType_typedef_resolve_all(t));
|
||||
}
|
||||
|
||||
virtual int functionWrapper(Node *n) {
|
||||
char *iname = GetChar(n,"sym:name");
|
||||
SwigType *d = Getattr(n,"type");
|
||||
|
|
@ -1014,10 +1033,13 @@ public:
|
|||
}
|
||||
|
||||
String *normalizeTemplatedClassName( String *name ) {
|
||||
String *name_normalized = Copy(name);
|
||||
String *name_normalized = SwigType_typedef_resolve_all(name);
|
||||
|
||||
if( is_a_pointer(name_normalized) )
|
||||
SwigType_del_pointer( name_normalized );
|
||||
|
||||
if( is_a_reference(name_normalized) )
|
||||
oc_SwigType_del_reference( name_normalized );
|
||||
|
||||
Replaceall(name_normalized,"(","");
|
||||
Replaceall(name_normalized,")","");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue