[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
|
|
@ -1,6 +1,13 @@
|
||||||
Version 1.3.32 (in progress)
|
Version 1.3.32 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
05/26/2007: olly
|
||||||
|
[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).
|
||||||
|
|
||||||
05/25/2007: wsfulton
|
05/25/2007: wsfulton
|
||||||
Fixed %rename inconsistency in conversion operators as reported by Zhong Ren. The matching
|
Fixed %rename inconsistency in conversion operators as reported by Zhong Ren. The matching
|
||||||
is now done on the operator name in the same way as it is done for parameters. For example:
|
is now done on the operator name in the same way as it is done for parameters. For example:
|
||||||
|
|
|
||||||
|
|
@ -1833,6 +1833,14 @@ public:
|
||||||
String *mangled = NewString("_p");
|
String *mangled = NewString("_p");
|
||||||
Printf(mangled, "%s", SwigType_manglestr(ret_type));
|
Printf(mangled, "%s", SwigType_manglestr(ret_type));
|
||||||
Node *class_node = Getattr(zend_types, mangled);
|
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) {
|
if (i.item) {
|
||||||
Printf(output, "case \"%s\": ", mangled);
|
Printf(output, "case \"%s\": ", mangled);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1841,7 +1849,10 @@ public:
|
||||||
const char *classname = GetChar(class_node, "sym:name");
|
const char *classname = GetChar(class_node, "sym:name");
|
||||||
if (!classname)
|
if (!classname)
|
||||||
classname = GetChar(class_node, "name");
|
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);
|
Delete(mangled);
|
||||||
}
|
}
|
||||||
Printf(output, "\t\t}\n");
|
Printf(output, "\t\t}\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue