summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-05-02 12:36:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-05-02 12:36:42 (GMT)
commit910200b637f2025d21da89213ea124bb28785632 (patch)
tree8b62b8b91ec50b4a1f9d4ab8ae6d66ad265c077e /tools
parentbe831d7ecb9df8ebfad280ac50be1773124c08bd (diff)
downloadtcl-910200b637f2025d21da89213ea124bb28785632.zip
tcl-910200b637f2025d21da89213ea124bb28785632.tar.gz
tcl-910200b637f2025d21da89213ea124bb28785632.tar.bz2
Extend "deprecated" functionality of genStubs.tcl: XX_DEPRECATED macro now accepts a message text, which will be used in the compiler's error message.
Not used (yet) in Tcl.
Diffstat (limited to 'tools')
-rw-r--r--tools/genStubs.tcl32
1 files changed, 19 insertions, 13 deletions
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index 742aa46..5956711 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,7 +470,7 @@ proc genStubs::makeDecl {name decl index} {
append text "/* $index */\n"
if {[info exists stubs($name,deprecated,$index)]} {
- set line "[string toupper $libraryName]_DEPRECATED $rtype"
+ set line "[string toupper $libraryName]_DEPRECATED(\"$stubs($name,deprecated,$index)\")\n$rtype"
} else {
set line "$scspec $rtype"
}
@@ -582,11 +584,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