delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/04/12:17:32

X-Spam-Check-By: sourceware.org
Message-ID: <BAY112-DAV1536FDE0BC46F37EE83C68C5B80@phx.gbl>
X-Sender: arundelo AT hotmail DOT com
From: "Aaron Brown" <arundelo AT hotmail DOT com>
To: <cygwin AT cygwin DOT com>
Subject: Compile-time detection of EOL translation mode (CLISP)
Date: Thu, 4 Jan 2007 12:17:16 -0500
MIME-Version: 1.0
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: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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*
  #<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
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019