This is the mail archive of the cygwin 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]

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

 [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/


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