Improve director unwrap detection for the return type

Resolve the return type to correctly determine if the type is a pointer or
reference to a director class.

SwigType_refptr_count_return() recently added as a simpler fix is no
longer needed.

The conventional approach of using the "type" rather than "decl" to
analyse the return type is used instead too.

Issue #1823
This commit is contained in:
William S Fulton 2022-10-10 08:27:44 +01:00
commit 2f55379687
10 changed files with 76 additions and 90 deletions

View file

@ -248,7 +248,7 @@ static void cparse_template_expand(Node *templnode, Node *n, String *tname, Stri
static void cparse_fix_function_decl(String *name, SwigType *decl, SwigType *type) {
String *prefix;
int prefixLen;
SwigType* last;
SwigType *last;
/* The type's prefix is what potentially has to be moved to the end of 'decl' */
prefix = SwigType_prefix(type);
@ -275,8 +275,7 @@ static void cparse_fix_function_decl(String *name, SwigType *decl, SwigType *typ
Append(decl, prefix);
Delslice(type, 0, prefixLen);
if (template_debug) {
Printf(stdout, " change function '%s' to type='%s', decl='%s'\n",
name, type, decl);
Printf(stdout, " change function '%s' to type='%s', decl='%s'\n", name, type, decl);
}
}
@ -510,7 +509,6 @@ int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab
}
}
}
cparse_postprocess_expanded_template(n);
/* Patch bases */