summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-04 10:02:58 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-04 10:02:58 (GMT)
commit010943474bbcde5b833c6e406b47e9d90a385c3a (patch)
tree99f9f484f4fa56f4a9cbd95b334ed715b15b66ab /tools
parent71bc6d6f0a3521ab154d247c7cfe368918b0475b (diff)
downloadtcl-010943474bbcde5b833c6e406b47e9d90a385c3a.zip
tcl-010943474bbcde5b833c6e406b47e9d90a385c3a.tar.gz
tcl-010943474bbcde5b833c6e406b47e9d90a385c3a.tar.bz2
Put extern "C" guards around all stub table struct definitions, so it is usable for C++ compilers as well without the danger of modifying the calling convention.
For tclDecls.h it was no problem, because tcl.h already contains those guards. But for the other *Decls.h files (e.g. tclTomMathDecls.h) it was not correct.
Diffstat (limited to 'tools')
-rw-r--r--tools/genStubs.tcl5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index c7dbe93..37205b2 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -991,6 +991,8 @@ proc genStubs::emitHeader {name} {
append text "#define ${CAPName}_STUBS_REVISION $revision\n"
}
+ append text "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
+
emitDeclarations $name text
if {[info exists hooks($name)]} {
@@ -1014,8 +1016,7 @@ proc genStubs::emitHeader {name} {
append text "} ${capName}Stubs;\n\n"
- append text "#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
- append text "extern ${capName}Stubs *${name}StubsPtr;\n"
+ append text "extern ${capName}Stubs *${name}StubsPtr;\n\n"
append text "#ifdef __cplusplus\n}\n#endif\n"
emitMacros $name text