Fix generation of multiple throws

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

View file

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