diff options
author | Richard Levitte <levitte@openssl.org> | 2015-03-24 15:02:51 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-03-24 19:46:53 +0100 |
commit | fa327fafe2184e6f1d7f3f2a663d00034c5d22b3 (patch) | |
tree | 9a33c73d947ab1cb014bfa117c9b4bdb202996ab | |
parent | e5991ec528b1c339062440811e2641f5ea2b328b (diff) |
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>
-rwxr-xr-x | util/mkdef.pl | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/util/mkdef.pl b/util/mkdef.pl index b549a60d60..1d47561f4c 100755 --- a/util/mkdef.pl +++ b/util/mkdef.pl @@ -487,7 +487,14 @@ sub do_defs while(<IN>) { if($parens > 0) { #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; } if (/\/\* Error codes for the \w+ functions\. \*\//) @@ -881,9 +888,15 @@ sub do_defs "EXPORT_VAR_AS_FUNCTION", "FUNCTION"); } elsif (/^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/) { - $def .= "$1(void);"; $parens = count_parens($_); - next; + 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; + } } elsif ($tag{'CONST_STRICT'} != 1) { if (/\{|\/\*|\([^\)]*$/) { $line = $_; |