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:
parent
96d86b0fec
commit
07e3d62ae8
1 changed files with 7 additions and 4 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue