ECDH: Add #ifdef filter to tests/scripts/list-enum-consts.pl

This allows the use of #ifdef ... #endif in enum definitions (e.g.,
mbedtls_ecdh_variant in ecdh.h).
This commit is contained in:
Christoph M. Wintersteiger 2018-10-25 13:12:05 +01:00 committed by Janos Follath
parent c9f737b4ba
commit 6817b9e819

View file

@ -22,7 +22,7 @@ while (<>)
$state = 'in';
} elsif( $state eq 'in' and /}/ ) {
$state = 'out';
} elsif( $state eq 'in' ) {
} elsif( $state eq 'in' and not (/^#if/ or /#endif/)) {
s/=.*//; s!/\*.*!!; s/,.*//; s/\s+//g; chomp;
push @consts, $_ if $_;
}