summaryrefslogtreecommitdiffstats
path: root/tools/genStubs.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-06-22 12:25:35 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-06-22 12:25:35 (GMT)
commit69201f94bdcef502012a231e2100bceef5062f90 (patch)
tree318ce059db03075568b505a7caa2624fce436e13 /tools/genStubs.tcl
parent6aa0cc7188b6df1dac97b03bc0b9240aa780799b (diff)
parentf57dacd4955b9dd474cfd9d4e4d55cac22990f6c (diff)
downloadtcl-tip_463.zip
tcl-tip_463.tar.gz
tcl-tip_463.tar.bz2
merge trunktip_463
Diffstat (limited to 'tools/genStubs.tcl')
-rw-r--r--tools/genStubs.tcl35
1 files changed, 21 insertions, 14 deletions
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index 742aa46..830ba2b 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -191,19 +191,21 @@ proc genStubs::declare {args} {
regsub -all "\[ \t\n\]+" [string trim $decl] " " decl
set decl [parseDecl $decl]
- foreach platform $platformList {
- if {$decl ne ""} {
- set stubs($curName,$platform,$index) $decl
- if {![info exists stubs($curName,$platform,lastNum)] \
- || ($index > $stubs($curName,$platform,lastNum))} {
- set stubs($curName,$platform,lastNum) $index
- }
+ if {([lindex $platformList 0] eq "deprecated")} {
+ set stubs($curName,deprecated,$index) [lindex $platformList 1]
+ set stubs($curName,generic,$index) $decl
+ if {![info exists stubs($curName,generic,lastNum)] \
+ || ($index > $stubs($curName,generic,lastNum))} {
+ set stubs($curName,generic,lastNum) $index
}
- if {$platformList eq "deprecated"} {
- set stubs($curName,generic,$index) $decl
- if {![info exists stubs($curName,generic,lastNum)] \
- || ($index > $stubs($curName,generic,lastNum))} {
- set stubs($curName,$platform,lastNum) $index
+ } else {
+ foreach platform $platformList {
+ if {$decl ne ""} {
+ set stubs($curName,$platform,$index) $decl
+ if {![info exists stubs($curName,$platform,lastNum)] \
+ || ($index > $stubs($curName,$platform,lastNum))} {
+ set stubs($curName,$platform,lastNum) $index
+ }
}
}
}
@@ -468,9 +470,10 @@ proc genStubs::makeDecl {name decl index} {
append text "/* $index */\n"
if {[info exists stubs($name,deprecated,$index)]} {
- set line "[string toupper $libraryName]_DEPRECATED $rtype"
+ append text "[string toupper $libraryName]_DEPRECATED(\"$stubs($name,deprecated,$index)\")\n"
+ set line "$rtype"
} else {
- set line "$scspec $rtype"
+ set line "$scspec $rtype"
}
set count [expr {2 - ([string length $line] / 8)}]
append line [string range "\t\t\t" 0 $count]
@@ -582,11 +585,15 @@ proc genStubs::makeMacro {name decl index} {
proc genStubs::makeSlot {name decl index} {
lassign $decl rtype fname args
+ variable stubs
set lfname [string tolower [string index $fname 0]]
append lfname [string range $fname 1 end]
set text " "
+ if {[info exists stubs($name,deprecated,$index)]} {
+ append text "TCL_DEPRECATED_API(\"$stubs($name,deprecated,$index)\") "
+ }
if {$args eq ""} {
append text $rtype " *" $lfname "; /* $index */\n"
return $text