This is the mail archive of the
mailing list for the Cygwin project.
Compile-time detection of EOL translation mode (CLISP)
- From: "Aaron Brown" <arundelo at hotmail dot com>
- To: <cygwin at cygwin dot com>
- Date: Thu, 4 Jan 2007 12:17:16 -0500
- Subject: Compile-time detection of EOL translation mode (CLISP)
From within the C preprocessor, how do I find out whether a
Cygwin installation is set to use dos or unix EOLs?
The reason I ask is this: I'm using version 2.41 as
downloaded from a Cygwin mirror, and my
*default-file-encoding* uses dos-style line terminators
#<ENCODING CHARSET:ASCII :DOS>
even though my Cygwin installation is set to use unix ones.
With help from comp.lang.lisp, I found that this is set in
#if defined(WIN32) || (defined(UNIX) && (O_BINARY != 0))
pushSTACK(S(Kdos)); /* :line-terminator */
pushSTACK(S(Kunix)); /* :line-terminator */
Specifically, O_BINARY is 0x10000 (even though it should
have no effect on my Cygwin installation).
I kluged around this by using "#if 0", but it really should
look at the Cygwin installation's EOL setting. How can this
be done? (Perhaps check the CYGWIN environment variable in
(The reason CLISP doesn't just open files in text mode is
that it does its own EOL translation, controllable at
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html