[PHP5]
Fix wrapping of methods and functions which return a pointer to a class (bug#1700788) and those which have overloaded forms returning both classes and non-classes (bug#1712717, thanks to Simon Berthiaume for the patch). git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9838 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3e5f30c94f
commit
dc61936359
2 changed files with 19 additions and 1 deletions
|
|
@ -1833,6 +1833,14 @@ public:
|
|||
String *mangled = NewString("_p");
|
||||
Printf(mangled, "%s", SwigType_manglestr(ret_type));
|
||||
Node *class_node = Getattr(zend_types, mangled);
|
||||
if (!class_node) {
|
||||
/* This is needed when we're returning a pointer to a type
|
||||
* rather than returning the type by value or reference. */
|
||||
class_node = current_class;
|
||||
Delete(mangled);
|
||||
mangled = NewString(SwigType_manglestr(ret_type));
|
||||
class_node = Getattr(zend_types, mangled);
|
||||
}
|
||||
if (i.item) {
|
||||
Printf(output, "case \"%s\": ", mangled);
|
||||
} else {
|
||||
|
|
@ -1841,7 +1849,10 @@ public:
|
|||
const char *classname = GetChar(class_node, "sym:name");
|
||||
if (!classname)
|
||||
classname = GetChar(class_node, "name");
|
||||
Printf(output, "return new %s%s($r);\n", prefix, classname);
|
||||
if (classname)
|
||||
Printf(output, "return new %s%s($r);\n", prefix, classname);
|
||||
else
|
||||
Printf(output, "return $r;\n");
|
||||
Delete(mangled);
|
||||
}
|
||||
Printf(output, "\t\t}\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue