Fix generation of multiple throws

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5939 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-05-29 03:34:40 +00:00
commit 7cf48c0f25

View file

@ -414,6 +414,7 @@ void emit_action(Node *n, Wrapper *f) {
Printv(eaction, action, NIL);
if (throws) {
int unknown_catch = 0;
Printf(eaction,"}\n");
for (Parm *ep = throws; ep; ep = nextSibling(ep)) {
String *em = Swig_typemap_lookup_new("throws",ep,"_e",0);
@ -423,10 +424,14 @@ void emit_action(Node *n, Wrapper *f) {
Printf(eaction,"}\n");
} else {
Swig_warning(WARN_TYPEMAP_THROW, Getfile(n), Getline(n),
"No 'throw' typemap defined for exception type '%s'\n", SwigType_str(Getattr(ep,"type"),0));
Printf(eaction,"catch(...) { throw; }\n");
"No 'throw' typemap defined for exception type '%s'\n",
SwigType_str(Getattr(ep,"type"),0));
unknown_catch = 1;
}
}
if (unknown_catch) {
Printf(eaction,"catch(...) { throw; }\n");
}
}
/* Look for except typemap (Deprecated) */