aboutsummaryrefslogtreecommitdiffstats
path: root/util/mkdef.pl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2014-12-17 13:17:26 +0000
committerMatt Caswell <matt@openssl.org>2014-12-18 19:56:31 +0000
commit07c4c14c4739da0c44562328afb6e7273e51298c (patch)
tree1c936bd77997d866504eb97ef3cdf3fd76601713 /util/mkdef.pl
parent59ff1ce06108508eba0f289b295dd89582c9fbfc (diff)
downloadopenssl-07c4c14c4739da0c44562328afb6e7273e51298c.tar.gz
Turn on OPENSSL_NO_DEPRECATED by default.
Also introduce OPENSSL_USE_DEPRECATED. If OPENSSL_NO_DEPRECATED is defined at config stage then OPENSSL_USE_DEPRECATED has no effect - deprecated functions are not available. If OPENSSL_NO_DEPRECATED is not defined at config stage then applications must define OPENSSL_USE_DEPRECATED in order to access deprecated functions. Also introduce compiler warnings for gcc for applications using deprecated functions Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'util/mkdef.pl')
-rwxr-xr-xutil/mkdef.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/util/mkdef.pl b/util/mkdef.pl
index 03a9b40a0a..fa3f3dbe76 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -433,6 +433,7 @@ sub do_defs
# is the same name as the original.
my $cpp;
my %unknown_algorithms = ();
+ my $parens = 0;
foreach $file (split(/\s+/,$symhacksfile." ".$files))
{
@@ -443,6 +444,7 @@ sub do_defs
(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,
@@ -505,6 +507,11 @@ sub do_defs
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;
@@ -608,6 +615,8 @@ sub do_defs
pop(@tag);
if ($t =~ /^OPENSSL_NO_([A-Z0-9_]+)$/) {
$t=$1;
+ } elsif($t =~ /^OPENSSL_USE_([A-Z0-9_]+)$/) {
+ $t=$1;
} else {
$t="";
}
@@ -657,10 +666,15 @@ sub do_defs
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).":"
@@ -891,6 +905,10 @@ sub do_defs
&$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 = $_;
@@ -1549,3 +1567,13 @@ sub check_existing
}
}
+sub count_parens
+{
+ my $line = shift(@_);
+
+ my $open = $line =~ tr/\(//;
+ my $close = $line =~ tr/\)//;
+
+ return $open - $close;
+}
+