summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-15 11:48:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-15 11:48:05 (GMT)
commit1892e61aa6a78031b136ba00cedcddec2c3a534d (patch)
treed44984046a6266997c88557bb2563ad347cd9562 /tools
parent4a2c3d9ab9bddefd822a41b5c8ce7fa80894860d (diff)
downloadtcl-1892e61aa6a78031b136ba00cedcddec2c3a534d.zip
tcl-1892e61aa6a78031b136ba00cedcddec2c3a534d.tar.gz
tcl-1892e61aa6a78031b136ba00cedcddec2c3a534d.tar.bz2
Simplification: don't declare struct types that are never used.
Diffstat (limited to 'tools')
-rw-r--r--tools/genStubs.tcl8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index dea63e6..bbeb4bf 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -986,7 +986,7 @@ proc genStubs::emitHeader {name} {
emitDeclarations $name text
if {[info exists hooks($name)]} {
- append text "\ntypedef struct ${capName}StubHooks {\n"
+ append text "\ntypedef struct {\n"
foreach hook $hooks($name) {
set capHook [string toupper [string index $hook 0]]
append capHook [string range $hook 1 end]
@@ -1000,7 +1000,11 @@ proc genStubs::emitHeader {name} {
append text " int epoch;\n"
append text " int revision;\n"
}
- append text " const struct ${capName}StubHooks *hooks;\n\n"
+ if {[info exists hooks($name)]} {
+ append text " const ${capName}StubHooks *hooks;\n\n"
+ } else {
+ append text " void *hooks;\n\n"
+ }
emitSlots $name text