Tweak Perl's director method's $result variable generation.
Use same code as other languages - no real change in output.
This commit is contained in:
parent
717b7866d4
commit
589b7237e9
1 changed files with 17 additions and 18 deletions
|
|
@ -2138,27 +2138,26 @@ public:
|
||||||
* if the return value is a reference or const reference, a specialized typemap must
|
* if the return value is a reference or const reference, a specialized typemap must
|
||||||
* handle it, including declaration of c_result ($result).
|
* handle it, including declaration of c_result ($result).
|
||||||
*/
|
*/
|
||||||
if (!is_void) {
|
if (!is_void && (!ignored_method || pure_virtual)) {
|
||||||
if (!ignored_method || pure_virtual) {
|
if (!SwigType_isclass(returntype)) {
|
||||||
if (!SwigType_isclass(returntype)) {
|
if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) {
|
||||||
if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) {
|
String *construct_result = NewStringf("= SwigValueInit< %s >()", SwigType_lstr(returntype, 0));
|
||||||
String *construct_result = NewStringf("= SwigValueInit< %s >()", SwigType_lstr(returntype, 0));
|
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), construct_result, NIL);
|
||||||
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), construct_result, NIL);
|
Delete(construct_result);
|
||||||
Delete(construct_result);
|
|
||||||
} else {
|
|
||||||
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), "= 0", NIL);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
String *cres = SwigType_lstr(returntype, "c_result");
|
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), "= 0", NIL);
|
||||||
Printf(w->code, "%s;\n", cres);
|
|
||||||
Delete(cres);
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
String *cres = SwigType_lstr(returntype, "c_result");
|
||||||
|
Printf(w->code, "%s;\n", cres);
|
||||||
|
Delete(cres);
|
||||||
}
|
}
|
||||||
if (!ignored_method) {
|
}
|
||||||
String *pres = NewStringf("SV *%s", Swig_cresult_name());
|
|
||||||
Wrapper_add_local(w, Swig_cresult_name(), pres);
|
if (!is_void && !ignored_method) {
|
||||||
Delete(pres);
|
String *pres = NewStringf("SV *%s", Swig_cresult_name());
|
||||||
}
|
Wrapper_add_local(w, Swig_cresult_name(), pres);
|
||||||
|
Delete(pres);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ignored_method) {
|
if (ignored_method) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue