minor fix for extern declarations

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6643 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-11-03 09:57:16 +00:00
commit db4de01921

View file

@ -816,8 +816,13 @@ int Language::cDeclaration(Node *n) {
if (!NoExtern) {
if (f_header) {
if ((Cmp(storage,"extern") == 0) || (ForceExtern && !storage)) {
Printf(f_header,"extern %s", SwigType_str(ty,name));
/* we don't need the 'extern' part in the C/C++ declaration,
and it produces some problems when namespace and SUN
Studio is used.
Printf(f_header,"extern %s", SwigType_str(ty,name));
*/
Printf(f_header,"%s", SwigType_str(ty,name));
{
DOH *t = Getattr(n,"throws");
if (t) {
@ -832,7 +837,8 @@ int Language::cDeclaration(Node *n) {
}
Printf(f_header,";\n");
} else if (Cmp(storage,"externc") == 0) {
Printf(f_header,"extern \"C\" %s;\n", SwigType_str(ty,name));
/* here 'extern "C"' is needed */
Printf(f_header, "extern \"C\" %s;\n", SwigType_str(ty,name));
}
}
}