Permalink
Browse files

Update typedef code.

  • Loading branch information...
1 parent 705bbb2 commit cdb6d4ddbe5767bc8429c784237777e20d7ce657 @adunstan adunstan committed May 6, 2011
Showing with 7 additions and 8 deletions.
  1. +7 −8 run_build.pl
View
@@ -1323,9 +1323,7 @@ sub make_ecpg_check
sub find_typedefs
{
my @err = `objdump -W 2>&1`;
- @err = () if `uname -s 2>&1` =~ /CYGWIN/i;
my @readelferr = `readelf -w 2>&1`;
- @readelferr = () if `uname -s 2>&1` =~ /CYGWIN/i;
my %syms;
my @dumpout;
my @flds;
@@ -1382,17 +1380,18 @@ sub find_typedefs
my $setfound = sub
{
return unless (-f $_ && /^.*\.[chly]\z/);
+ local ($/) = undef;
my @lines;
my $handle;
open ($handle,$_);
- while (my $line=<$handle>)
+ my $src = <$handle>;
+ close ($handle);
+ # strip C comments - see perlfaq6
+ $src =~ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $2 ? $2 : ""#gse;
+ foreach my $word (split(/\W+/,$src))
{
- foreach my $word (split(/\W+/,$line))
- {
- $foundwords{$word} = 1;
- }
+ $foundwords{$word} = 1;
}
- close($handle);
};
File::Find::find($setfound,"$branch_root/pgsql");

0 comments on commit cdb6d4d

Please sign in to comment.