summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/parsevar.pl9
1 files changed, 8 insertions, 1 deletions
diff --git a/util/parsevar.pl b/util/parsevar.pl
index fe2f2dc0..97689a19 100644
--- a/util/parsevar.pl
+++ b/util/parsevar.pl
@@ -13,8 +13,15 @@ print << '.';
while( <> ){
if( /^\w/ ){
chomp;
- $_ = substr($_, 0, index($_, '=') - 1) if( index($_, '=') != -1 );
+ s|//.*||;
+ s|/\*.*?\*/||;
+ s/\=\s*\{.*?\}//;
+
+ s/\=.*?([,;])/$1/g;
+ s/\=.*?\{//g;
$_ .= ';' if( index($_, ';') == -1 );
+ s/\=.*?([,;])/$1/g;
+ s/\=.*?\{//g;
print "extern $_\n";
} elsif( /^\s*\#/ && !/include/ ){
print;