diff options
Diffstat (limited to 'winsup/cygwin/gendef')
-rwxr-xr-x | winsup/cygwin/gendef | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef index 7c17a11ee..9c17010b4 100755 --- a/winsup/cygwin/gendef +++ b/winsup/cygwin/gendef @@ -8,7 +8,8 @@ # details. # use strict; -sub nocr(@); +sub cleanup(@); + my $in = shift; my $tls_offsets = shift; my $out = shift; @@ -24,11 +25,11 @@ require $tls_offsets; open(IN, $in) or die "$0: couldn't open \"$in\" - $!\n"; my @top = (); while (<IN>) { - push(@top, nocr $_); + push(@top, cleanup $_); last if /^\s*exports\s*$/i; } -my $libline = nocr scalar(<IN>); -my @in = nocr <IN>; +my $libline = cleanup scalar(<IN>); +my @in = cleanup <IN>; close(IN); my %sigfe = (); @@ -456,6 +457,8 @@ _longjmp: EOF } -sub nocr(@) { +sub cleanup(@) { map {s/\r//g; $_} @_; + map {s/#.*//g; $_} @_; + map {s/[ \t]+$//g; $_} @_; } |