summaryrefslogtreecommitdiff
path: root/gtkdoc-scan.in
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-06-26 11:14:25 -0400
committerStefan Sauer <ensonic@users.sf.net>2014-01-23 08:17:55 +0100
commitb856f3d05e3931c5d29ad0799f2b2417a2f83821 (patch)
tree4d5945685c8dde5d764c587ba4cbc6f7be6d7be4 /gtkdoc-scan.in
parent21a0c5ea974dd5dfc2701e00853d4308be0d51ce (diff)
downloadgtk-doc-b856f3d05e3931c5d29ad0799f2b2417a2f83821.tar.gz
gtkdoc-scan: recognise attribute-based deprecations
If we see something that looks like a macro for an attribute-based deprecation (ie: some string matching /_DEPRECATED/) then mark the next single declaration as <DEPRECATED/> in the -decl.txt. This avoids the warning for missing deprecation guards. Add Deprecated: tags to the doc-blobs of the existing tests to verify that we don't get the warnings. Fixes: #624001
Diffstat (limited to 'gtkdoc-scan.in')
-rwxr-xr-xgtkdoc-scan.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index cf72293..6493199 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -370,6 +370,13 @@ sub ScanHeader {
}
}
+ # If we find a line containing _DEPRECATED, we hope that this is
+ # attribute based deprecation and also treat this as a deprecation
+ # guard.
+ if ($deprecated_conditional_nest == 0 and m/_DEPRECATED/) {
+ $deprecated_conditional_nest += 0.1;
+ }
+
# set global that is used later when we do AddSymbolToList
if ($deprecated_conditional_nest > 0) {
$deprecated = "<DEPRECATED/>\n";
@@ -751,6 +758,7 @@ sub ScanHeader {
} else {
$internal = 0;
}
+ $deprecated_conditional_nest = int($deprecated_conditional_nest);
$in_declaration = "";
$skip_block = 0;
}
@@ -761,6 +769,7 @@ sub ScanHeader {
if (&AddSymbolToList (\$list, $symbol)) {
print DECL "<USER_FUNCTION>\n<NAME>$symbol</NAME>\n$deprecated<RETURNS>$ret_type</RETURNS>\n$decl</USER_FUNCTION>\n";
}
+ $deprecated_conditional_nest = int($deprecated_conditional_nest);
$in_declaration = "";
}
}
@@ -774,6 +783,7 @@ sub ScanHeader {
} else {
$internal = 0;
}
+ $deprecated_conditional_nest = int($deprecated_conditional_nest);
$in_declaration = "";
}
}
@@ -786,6 +796,7 @@ sub ScanHeader {
if (&AddSymbolToList (\$list, $symbol)) {
print DECL "<ENUM>\n<NAME>$symbol</NAME>\n$deprecated$decl</ENUM>\n";
}
+ $deprecated_conditional_nest = int($deprecated_conditional_nest);
$in_declaration = "";
}
}
@@ -812,6 +823,7 @@ sub ScanHeader {
undef($forward_decls{$symbol});
}
}
+ $deprecated_conditional_nest = int($deprecated_conditional_nest);
$in_declaration = "";
} else {
# We use tr to count the brackets in the line, and adjust