This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: CR/NL problem with cpp.exe


Nick, please refer to:

"How is the DOS/Unix CR/LF thing handled?" in the cygwin faq:
http://cygwin.com/faq/faq_4.html#SEC72
Also, read the documentation for the "mount" utility and the CYGWIN
environment variable setting.

If you want to make sure that the input to your "cpp" is translated no
matter the file access mode (which depends on the mount mode for files and
CYGWIN variable for pipes), I believe you need to make sure that the input
is set to text mode:
- when opening a file, add the text mode to the open calls:
    o fopen(..., "rt")
    o open(..., O_..... | O_TEXT)
- when reading text from stdin:
    o setmode (0, O_TEXT) // 0 is the file descriptor for stdin
.

Dan


-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
Of Kris Warkentin
Sent: Tuesday, October 01, 2002 8:47 PM
To: cygwin@cygwin.com
Subject: Re: CR/NL problem with cpp.exe


>  printf("This is a long string across\
>   multiple lines");
>
> or a backslashified #define is being concatenated.  Now, if I use the
Cygwin
> cpp.exe, I get the following (expected) behaviour:

Correction: I meant NOT being concatenated.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]