summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-04 10:13:59 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-04 10:13:59 (GMT)
commita32fae2595e52296e08d1240fcf93f2161074f62 (patch)
treea6b1e3a8b762411c6222dc520b2ea0efcd935324 /tools
parentb5f69350e3ff6666d6077535041901c8d04b3617 (diff)
parent49f8bb2d42c970325160658862b0a7f0e2cd066a (diff)
downloadtcl-a32fae2595e52296e08d1240fcf93f2161074f62.zip
tcl-a32fae2595e52296e08d1240fcf93f2161074f62.tar.gz
tcl-a32fae2595e52296e08d1240fcf93f2161074f62.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 and tclOODecls.h it was no problem, because tcl.h and tclOO.h already contain 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 93e0a9a..b45e560 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -983,6 +983,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)]} {
@@ -1010,8 +1012,7 @@ proc genStubs::emitHeader {name} {
append text "} ${capName}Stubs;\n\n"
- append text "#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
- append text "extern const ${capName}Stubs *${name}StubsPtr;\n"
+ append text "extern const ${capName}Stubs *${name}StubsPtr;\n\n"
append text "#ifdef __cplusplus\n}\n#endif\n"
emitMacros $name text