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:
William S Fulton 2017-12-14 18:58:06 +00:00
commit 589b7237e9

View file

@ -2138,8 +2138,7 @@ 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));
@ -2154,12 +2153,12 @@ public:
Delete(cres); Delete(cres);
} }
} }
if (!ignored_method) {
if (!is_void && !ignored_method) {
String *pres = NewStringf("SV *%s", Swig_cresult_name()); String *pres = NewStringf("SV *%s", Swig_cresult_name());
Wrapper_add_local(w, Swig_cresult_name(), pres); Wrapper_add_local(w, Swig_cresult_name(), pres);
Delete(pres); Delete(pres);
} }
}
if (ignored_method) { if (ignored_method) {
if (!pure_virtual) { if (!pure_virtual) {