From 138ffca57951a801c85e779cff8dad42543e2bb0 Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Fri, 26 Sep 2003 20:37:30 +0000 Subject: [PATCH] Fixed [ 812528 ] externs not correct when throw is in signature. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5162 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/lang.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/SWIG/Source/Modules/lang.cxx b/SWIG/Source/Modules/lang.cxx index 3a0a36d00..29a7b5351 100644 --- a/SWIG/Source/Modules/lang.cxx +++ b/SWIG/Source/Modules/lang.cxx @@ -774,7 +774,21 @@ int Language::cDeclaration(Node *n) { if (!NoExtern) { if (f_header) { if ((Cmp(storage,"extern") == 0) || (ForceExtern && !storage)) { - Printf(f_header,"extern %s;\n", SwigType_str(ty,name)); + Printf(f_header,"extern %s", SwigType_str(ty,name)); + + { + DOH *t = Getattr(n,"throws"); + if (t) { + Printf(f_header,"throw("); + while (t) { + Printf(f_header,"%s", Getattr(t,"type")); + t = nextSibling(t); + if (t) Printf(f_header,","); + } + Printf(f_header,")"); + } + } + Printf(f_header,";\n"); } else if (Cmp(storage,"externc") == 0) { Printf(f_header,"extern \"C\" %s;\n", SwigType_str(ty,name)); }