X-Spam-Check-By: sourceware.org Message-ID: X-Sender: arundelo AT hotmail DOT com From: "Aaron Brown" To: Subject: Compile-time detection of EOL translation mode (CLISP) Date: Thu, 4 Jan 2007 12:17:16 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 [1]> *default-file-encoding* # even though my Cygwin installation is set to use unix ones. With help from comp.lang.lisp, I found that this is set in src/encoding.d: #if defined(WIN32) || (defined(UNIX) && (O_BINARY != 0)) pushSTACK(S(Kdos)); /* :line-terminator */ #else pushSTACK(S(Kunix)); /* :line-terminator */ #endif 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 makefile?) (The reason CLISP doesn't just open files in text mode is that it does its own EOL translation, controllable at runtime.) Thanks, -- Aaron http://www.amazon.com/gp/product/0470069171/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/