[PATCH] mkglobals: Fix EOL detection

Orgad Shaneh orgads@gmail.com
Mon Aug 17 07:42:00 GMT 2015


When globals.cc has CRLF line endings, winsup.h is not removed, and
compilation fails for duplicate definitions.
---
 winsup/cygwin/mkglobals_h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/mkglobals_h b/winsup/cygwin/mkglobals_h
index ea4a582..2d185f2 100755
--- a/winsup/cygwin/mkglobals_h
+++ b/winsup/cygwin/mkglobals_h
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 my @argv = @ARGV;
 $_ = join('', <>);
+s/\s+\n/\n/sog;
 s/\n[^\n]*!globals.h[^\n]*\n/\n/sog;
 s%/\*.*?\*/%%sog;
 s/(enum\s.*?{.*?})/munge($1)/soge;
@@ -12,7 +13,6 @@ s/^\n+//sog;
 s/#include "winsup\.h"\n//so;
 s/-NL-/\n/sog;
 s/-EQ-/=/sog;
-s/\s+\n/\n/sog;
 s/\n{2,}/\n/sog;
 print <<PRELUDE,$_;
 /* $target - Autogenerated from @argv.  Look there for comments. */
--
2.4.6.windows.1



More information about the Cygwin-patches mailing list