# is the same name as the original.
my $cpp;
my %unknown_algorithms = ();
+ my $parens = 0;
foreach $file (split(/\s+/,$symhacksfile." ".$files))
{
(map { $_ => 0 } @known_platforms),
(map { "OPENSSL_SYS_".$_ => 0 } @known_ossl_platforms),
(map { "OPENSSL_NO_".$_ => 0 } @known_algorithms),
+ (map { "OPENSSL_USE_".$_ => 0 } @known_algorithms),
NOPROTO => 0,
PERL5 => 0,
_WINDLL => 0,
print STDERR "DEBUG: parsing ----------\n" if $debug;
while(<IN>) {
+ if($parens > 0) {
+ #Inside a DECLARE_DEPRECATED
+ $parens += count_parens($_);
+ next;
+ }
if (/\/\* Error codes for the \w+ functions\. \*\//)
{
undef @tag;
pop(@tag);
if ($t =~ /^OPENSSL_NO_([A-Z0-9_]+)$/) {
$t=$1;
+ } elsif($t =~ /^OPENSSL_USE_([A-Z0-9_]+)$/) {
+ $t=$1;
} else {
$t="";
}
map { $tag{"OPENSSL_SYS_".$_} == 1 ? $_ :
$tag{"OPENSSL_SYS_".$_} == -1 ? "!".$_ : "" }
@known_ossl_platforms);
+ @current_algorithms = ();
@current_algorithms =
grep(!/^$/,
map { $tag{"OPENSSL_NO_".$_} == -1 ? $_ : "" }
@known_algorithms);
+ push @current_algorithms
+ , grep(!/^$/,
+ map { $tag{"OPENSSL_USE_".$_} == 1 ? $_ : "" }
+ @known_algorithms);
$def .=
"#INFO:"
.join(',',@current_platforms).":"
&$make_variant("_shadow_$2","_shadow_$2",
"EXPORT_VAR_AS_FUNCTION",
"FUNCTION");
+ } elsif (/^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/) {
+ $def .= "$1(void);";
+ $parens = count_parens($_);
+ next;
} elsif ($tag{'CONST_STRICT'} != 1) {
if (/\{|\/\*|\([^\)]*$/) {
$line = $_;
}
}
+sub count_parens
+{
+ my $line = shift(@_);
+
+ my $open = $line =~ tr/\(//;
+ my $close = $line =~ tr/\)//;
+
+ return $open - $close;
+}
+