summaryrefslogtreecommitdiffstats
path: root/tools/genStubs.tcl
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)
commit0e8c0bebc1adffa78100e1740398a43860a2d13d (patch)
treed44984046a6266997c88557bb2563ad347cd9562 /tools/genStubs.tcl
parent9ae0d652824688e3ac54ef7d4df854cbedbefe72 (diff)
downloadtcl-0e8c0bebc1adffa78100e1740398a43860a2d13d.zip
tcl-0e8c0bebc1adffa78100e1740398a43860a2d13d.tar.gz
tcl-0e8c0bebc1adffa78100e1740398a43860a2d13d.tar.bz2
Simplification: don't declare struct types that are never used.
Diffstat (limited to 'tools/genStubs.tcl')
-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