fix typemap search, now you can add a typemap like %typemap(out) int *Foo::foo(int bar);
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6899 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f41a1ba089
commit
26655216ab
1 changed files with 23 additions and 4 deletions
|
|
@ -1164,16 +1164,16 @@ String *Swig_typemap_lookup_new(const String_or_char *op, Node *node, const Stri
|
||||||
SwigType *type;
|
SwigType *type;
|
||||||
SwigType *mtype = 0;
|
SwigType *mtype = 0;
|
||||||
String *pname;
|
String *pname;
|
||||||
Hash *tm;
|
Hash *tm = 0;
|
||||||
String *s = 0;
|
String *s = 0;
|
||||||
String *sdef = 0;
|
String *sdef = 0;
|
||||||
ParmList *locals;
|
ParmList *locals;
|
||||||
ParmList *kw;
|
ParmList *kw;
|
||||||
char temp[256];
|
char temp[256];
|
||||||
String *symname;
|
String *symname, *qsn;
|
||||||
String *cname = 0;
|
String *cname = 0;
|
||||||
String *clname = 0;
|
String *clname = 0;
|
||||||
|
Symtab *st;
|
||||||
/* special case, we need to check for 'ref' call
|
/* special case, we need to check for 'ref' call
|
||||||
and set the defaul code 'sdef' */
|
and set the defaul code 'sdef' */
|
||||||
if (Cmp(op,"newfree") == 0) {
|
if (Cmp(op,"newfree") == 0) {
|
||||||
|
|
@ -1184,7 +1184,26 @@ String *Swig_typemap_lookup_new(const String_or_char *op, Node *node, const Stri
|
||||||
if (!type) return sdef;
|
if (!type) return sdef;
|
||||||
|
|
||||||
pname = Getattr(node,"name");
|
pname = Getattr(node,"name");
|
||||||
tm = Swig_typemap_search(op,type,pname,&mtype);
|
st = Getattr(node,"sym:symtab");
|
||||||
|
qsn = st ? Swig_symbol_qualifiedscopename(st) : 0;
|
||||||
|
if (qsn && Len(qsn)) {
|
||||||
|
/* look qualified names first, such as
|
||||||
|
|
||||||
|
int *Foo::foo(int bar) -> Foo::foo
|
||||||
|
-> *::foo
|
||||||
|
-> Foo::*
|
||||||
|
*/
|
||||||
|
String *qname = NewStringf("%s::%s",qsn,pname);
|
||||||
|
tm = Swig_typemap_search(op,type,qname,&mtype);
|
||||||
|
Delete(qname);
|
||||||
|
}
|
||||||
|
Delete(qsn);
|
||||||
|
|
||||||
|
/* look now for simple name, such as
|
||||||
|
|
||||||
|
int *Foo::foo(int bar) -> foo
|
||||||
|
*/
|
||||||
|
if (!tm) tm = Swig_typemap_search(op,type,pname,&mtype);
|
||||||
if (!tm) return sdef;
|
if (!tm) return sdef;
|
||||||
|
|
||||||
s = Getattr(tm,"code");
|
s = Getattr(tm,"code");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue