Teach mkdef.pl to handle multiline declarations.
For the moment, this is specially crafted for DECLARE_DEPRECATED because that's where we found the problem, but it can easily be expanded to other types of special delarations when needed. Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
parent
e5991ec528
commit
fa327fafe2
@ -487,7 +487,14 @@ sub do_defs
|
|||||||
while(<IN>) {
|
while(<IN>) {
|
||||||
if($parens > 0) {
|
if($parens > 0) {
|
||||||
#Inside a DECLARE_DEPRECATED
|
#Inside a DECLARE_DEPRECATED
|
||||||
$parens += count_parens($_);
|
$stored_multiline .= $_;
|
||||||
|
chomp $stored_multiline;
|
||||||
|
print STDERR "DEBUG: Continuing multiline DEPRECATED: $stored_multiline\n" if $debug;
|
||||||
|
$parens = count_parens($stored_multiline);
|
||||||
|
if ($parens == 0) {
|
||||||
|
$stored_multiline =~ /^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/;
|
||||||
|
$def .= "$1(void);";
|
||||||
|
}
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if (/\/\* Error codes for the \w+ functions\. \*\//)
|
if (/\/\* Error codes for the \w+ functions\. \*\//)
|
||||||
@ -881,9 +888,15 @@ sub do_defs
|
|||||||
"EXPORT_VAR_AS_FUNCTION",
|
"EXPORT_VAR_AS_FUNCTION",
|
||||||
"FUNCTION");
|
"FUNCTION");
|
||||||
} elsif (/^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/) {
|
} elsif (/^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/) {
|
||||||
$def .= "$1(void);";
|
|
||||||
$parens = count_parens($_);
|
$parens = count_parens($_);
|
||||||
|
if ($parens == 0) {
|
||||||
|
$def .= "$1(void);";
|
||||||
|
} else {
|
||||||
|
$stored_multiline = $_;
|
||||||
|
chomp $stored_multiline;
|
||||||
|
print STDERR "DEBUG: Found multiline DEPRECATED starting with: $stored_multiline\n" if $debug;
|
||||||
next;
|
next;
|
||||||
|
}
|
||||||
} elsif ($tag{'CONST_STRICT'} != 1) {
|
} elsif ($tag{'CONST_STRICT'} != 1) {
|
||||||
if (/\{|\/\*|\([^\)]*$/) {
|
if (/\{|\/\*|\([^\)]*$/) {
|
||||||
$line = $_;
|
$line = $_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user