summaryrefslogtreecommitdiffstats
path: root/tools/genStubs.tcl
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)
commit49f8bb2d42c970325160658862b0a7f0e2cd066a (patch)
tree99f9f484f4fa56f4a9cbd95b334ed715b15b66ab /tools/genStubs.tcl
parent5873d26c7268ee5af9f31c126c64b4350736c458 (diff)
downloadtcl-49f8bb2d42c970325160658862b0a7f0e2cd066a.zip
tcl-49f8bb2d42c970325160658862b0a7f0e2cd066a.tar.gz
tcl-49f8bb2d42c970325160658862b0a7f0e2cd066a.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/genStubs.tcl')
-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