Use a single extern "C" around all the wrappers, not one per wrapper.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12126 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Ian Lance Taylor 2010-06-15 17:58:42 +00:00
commit 07e3d62ae8

View file

@ -385,6 +385,10 @@ private:
Printf(f_go_begin, "\npackage %s\n\n", package);
// All the C++ wrappers should be extern "C".
Printv(f_c_wrappers, "#ifdef __cplusplus\n", "extern \"C\" {\n", "#endif\n\n", NULL);
// Set up the hash table for types not defined by SWIG.
undefined_types = NewHash();
@ -433,6 +437,9 @@ private:
f_c_directors = NULL;
}
// End the extern "C".
Printv(f_c_wrappers, "#ifdef __cplusplus\n", "}\n", "#endif\n\n", NULL);
Dump(f_c_runtime, f_c_begin);
Dump(f_c_wrappers, f_c_begin);
Dump(f_c_init, f_c_begin);
@ -1149,8 +1156,6 @@ private:
// Start the function definition.
Printv(f->def, "#ifdef __cplusplus\n", "extern \"C\"\n", "#endif\n", NULL);
Printv(f->def, "void\n", wname, "(void *swig_v)\n", "{\n", NULL);
// The single function parameter is a pointer to the real argument
@ -1269,8 +1274,6 @@ private:
// Start the function definition.
Printv(f->def, "#ifdef __cplusplus\n", "extern \"C\"\n", "#endif\n", NULL);
String *fnname = NewString("");
Printv(fnname, go_prefix, "_", wname, "(", NULL);