diff options
Diffstat (limited to 'tools/genStubs.tcl')
-rw-r--r-- | tools/genStubs.tcl | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl index 9f2c6ca..830ba2b 100644 --- a/tools/genStubs.tcl +++ b/tools/genStubs.tcl @@ -191,12 +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 + } + } 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 + } } } } @@ -455,10 +464,17 @@ proc genStubs::parseArg {arg} { proc genStubs::makeDecl {name decl index} { variable scspec + variable stubs + variable libraryName lassign $decl rtype fname args append text "/* $index */\n" - set line "$scspec $rtype" + if {[info exists stubs($name,deprecated,$index)]} { + append text "[string toupper $libraryName]_DEPRECATED(\"$stubs($name,deprecated,$index)\")\n" + set line "$rtype" + } else { + set line "$scspec $rtype" + } set count [expr {2 - ([string length $line] / 8)}] append line [string range "\t\t\t" 0 $count] set pad [expr {24 - [string length $line]}] @@ -569,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 @@ -682,7 +702,10 @@ proc genStubs::forAllStubs {name slotProc onAll textVar for {set i 0} {$i <= $lastNum} {incr i} { set slots [array names stubs $name,*,$i] set emit 0 - if {[info exists stubs($name,generic,$i)]} { + if {[info exists stubs($name,deprecated,$i)]} { + append text [$slotProc $name $stubs($name,generic,$i) $i] + set emit 1 + } elseif {[info exists stubs($name,generic,$i)]} { if {[llength $slots] > 1} { puts stderr "conflicting generic and platform entries:\ $name $i" |