Mercurial > hg > CbC > CbC_gcc
diff contrib/make_sunver.pl @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | 561a7518be6b |
children |
line wrap: on
line diff
--- a/contrib/make_sunver.pl Sun Aug 21 07:07:55 2011 +0900 +++ b/contrib/make_sunver.pl Fri Oct 27 22:46:09 2017 +0900 @@ -16,10 +16,13 @@ # It depends on the GNU version of c++filt, since it must understand the # GNU mangling style. -use File::Glob ':glob'; use FileHandle; use IPC::Open2; +# Enforce C locale. +$ENV{'LC_ALL'} = "C"; +$ENV{'LANG'} = "C"; + # Input version script, GNU style. my $symvers = shift; @@ -157,9 +160,6 @@ # We're currently inside `extern "C++"', which Sun ld doesn't understand. my $in_extern = 0; -# We're currently inside a conditional section: just skip it. -my $in_ifdef = 0; - # The c++filt command to use. This *must* be GNU c++filt; the Sun Studio # c++filt doesn't handle the GNU mangling style. my $cxxfilt = $ENV{'CXXFILT'} || "c++filt"; @@ -184,21 +184,12 @@ print "#\n\n"; while (<F>) { - # End of skipped section. - if (/^[ \t]*\#endif/) { - $in_ifdef = 0; - next; - } - - # Just skip a conditional section. - if ($in_ifdef) { next; } - # Lines of the form '};' if (/^([ \t]*)(\}[ \t]*;[ \t]*)$/) { $glob = 'glob'; if ($in_extern) { $in_extern--; - print "$1##$2"; + print "$1##$2\n"; } else { print; } @@ -217,15 +208,6 @@ print; next; } - # Special comments that look like C preprocessor conditionals. - # Just skip the contents for now. - # FIXME: Allow passing in conditionals from the command line to really - # control the skipping. - if (/^[ \t]*\#ifdef/) { - $in_ifdef = 1; - next; - } - # Comment and blank lines if (/^[ \t]*\#/) { print; next; } if (/^[ \t]*$/) { print; next; } @@ -277,9 +259,10 @@ if (/^([ \t]*)([^ \t;{}#]+);?[ \t]*$/) { my $ws = $1; my $ptn = $2; - # Turn the glob into a regex by replacing '*' with '.*'. + # Turn the glob into a regex by replacing '*' with '.*', '?' with '.'. # Keep $ptn so we can still print the original form. ($pattern = $ptn) =~ s/\*/\.\*/g; + $pattern =~ s/\?/\./g; if ($glob eq 'ign') { # We're in a local: * section; just continue.