*** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4457 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
33617a5abd
commit
ee1f66921c
1 changed files with 12 additions and 6 deletions
|
|
@ -642,7 +642,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------
|
/* ---------------------------------------------------------------------
|
||||||
* insertCleanupCode(ParmList *l, String *cleanup)
|
* insertArgOutputCode(ParmList *l, String *outarg, int& need_result)
|
||||||
*
|
*
|
||||||
* Checks each of the parameters in the parameter list for a "argout"
|
* Checks each of the parameters in the parameter list for a "argout"
|
||||||
* typemap and (if it finds one) inserts the typemapping code into
|
* typemap and (if it finds one) inserts the typemapping code into
|
||||||
|
|
@ -861,17 +861,23 @@ public:
|
||||||
/* Wrap things up (in a manner of speaking) */
|
/* Wrap things up (in a manner of speaking) */
|
||||||
if (need_result) {
|
if (need_result) {
|
||||||
if (current == CONSTRUCTOR_ALLOCATE) {
|
if (current == CONSTRUCTOR_ALLOCATE) {
|
||||||
Printv(f->code, tab4, "return vresult;\n}\n", NIL);
|
Printv(f->code, tab4, "return vresult;\n", NIL);
|
||||||
} else if (current == CONSTRUCTOR_INITIALIZE) {
|
} else if (current == CONSTRUCTOR_INITIALIZE) {
|
||||||
Printv(f->code, tab4, "return self;\n}\n", NIL);
|
Printv(f->code, tab4, "return self;\n", NIL);
|
||||||
} else {
|
} else {
|
||||||
Wrapper_add_local(f,"vresult","VALUE vresult = Qnil");
|
Wrapper_add_local(f,"vresult","VALUE vresult = Qnil");
|
||||||
Printv(f->code, tab4, "return vresult;\n}\n", NIL);
|
Printv(f->code, tab4, "return vresult;\n", NIL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Printv(f->code, tab4, "return Qnil;\n}\n", NIL);
|
Printv(f->code, tab4, "return Qnil;\n", NIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Error handling code */
|
||||||
|
Printf(f->code,"fail:\n");
|
||||||
|
Printv(f->code,cleanup,NIL);
|
||||||
|
Printf(f->code,"rb_raise(rb_eRuntimeError,\"failure occurred\");\n"); /* not quite right! */
|
||||||
|
Printf(f->code,"}\n");
|
||||||
|
|
||||||
/* Substitute the cleanup code */
|
/* Substitute the cleanup code */
|
||||||
Replaceall(f->code,"$cleanup",cleanup);
|
Replaceall(f->code,"$cleanup",cleanup);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue