Re: [PATCH] mkglobals: Fix EOL detection

2015-08-17 Thread Corinna Vinschen
On Aug 17 10:41, Orgad Shaneh wrote:
 When globals.cc has CRLF line endings, winsup.h is not removed, and
 compilation fails for duplicate definitions.

Applied.


Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


pgpsnOBFpWLDP.pgp
Description: PGP signature


[PATCH] mkglobals: Fix EOL detection

2015-08-17 Thread Orgad Shaneh
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


Re: [PATCH] mkglobals: Fix EOL detection

2015-08-17 Thread Corinna Vinschen
On Aug 17 10:41, Orgad Shaneh wrote:
 When globals.cc has CRLF line endings, winsup.h is not removed, and
 compilation fails for duplicate definitions.

Why on earth should globals.h get CRLF line endings?  It's stored
with LF line endings in git.  There's no reason to convert the file.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


pgpBSGWLMtDQn.pgp
Description: PGP signature


Re: [PATCH] mkglobals: Fix EOL detection

2015-08-17 Thread Orgad Shaneh
On Mon, Aug 17, 2015 at 10:59 AM, Corinna Vinschen
corinna-cyg...@cygwin.com wrote:
 On Aug 17 10:41, Orgad Shaneh wrote:
 When globals.cc has CRLF line endings, winsup.h is not removed, and
 compilation fails for duplicate definitions.

 Why on earth should globals.h get CRLF line endings?  It's stored
 with LF line endings in git.  There's no reason to convert the file.

globals.h is generated, I guess you refer to globals.cc.

Well, git has a setting named core.autocrlf which converts
line-endings to CRLF on Windows.

This is very commonly used with msysGit and Git for Windows.

If the cygwin repository is cloned with autocrlf set, then all the
source files will have CRLF line endings, including globals.cc...

- Orgad


Re: [PATCH] mkglobals: Fix EOL detection

2015-08-17 Thread Corinna Vinschen
On Aug 17 11:02, Orgad Shaneh wrote:
 On Mon, Aug 17, 2015 at 10:59 AM, Corinna Vinschen
 corinna-cyg...@cygwin.com wrote:
  On Aug 17 10:41, Orgad Shaneh wrote:
  When globals.cc has CRLF line endings, winsup.h is not removed, and
  compilation fails for duplicate definitions.
 
  Why on earth should globals.h get CRLF line endings?  It's stored
  with LF line endings in git.  There's no reason to convert the file.
 
 globals.h is generated, I guess you refer to globals.cc.
 
 Well, git has a setting named core.autocrlf which converts
 line-endings to CRLF on Windows.
 
 This is very commonly used with msysGit and Git for Windows.
 
 If the cygwin repository is cloned with autocrlf set, then all the
 source files will have CRLF line endings, including globals.cc...

You should set core.autocrlf to no in Cygwin's local git config.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


pgp4CDRHseo10.pgp
Description: PGP signature