delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/02/23/02:49:56

Date: Fri, 23 Feb 2001 09:44:52 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De
Message-Id: <2110-Fri23Feb2001094452+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: haible AT ilog DOT fr, djgpp-workers AT delorie DOT com
In-reply-to: <2BBB1E41683@HRZ1.hrz.tu-darmstadt.de>
(ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De)
Subject: Re: gettext pretest available
References: <29F40F30739 AT HRZ1 DOT hrz DOT tu-darmstadt DOT de> <2BBB1E41683 AT HRZ1 DOT hrz DOT tu-darmstadt DOT de>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Juan Manuel Guerrero" <ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De>
> Organization: Darmstadt University of Technology
> Date: Thu, 22 Feb 2001 21:04:17 +0200
> 
> > >   #if ((__DJGPP__ == 2) && (__DJGPP_MINOR__ <= 3))
> > >   /* DJGPP 2.03 and prior only supports C and POSIX. */
> >
> > What about DJGPP 2.04 or 2.1? Do these versions have a full
> > setlocale()?
> Good question. I don't know. If someone of the djgpp-workers envolved
> with libc.a developement knows something about this, I will seriously
> appreciate a response to this question. Meanwhile I will replace
>   #if ((__DJGPP__ == 2) && (__DJGPP_MINOR__ <= 3))
> simply by
>   #ifdef __DJGPP__

I'm not aware of any real activity to add a working, non-trivial
setlocale to DJGPP, apart of someone who posted a partial-solution
code that was not reviewed yet.  Since adding working locales is a
huge job, it is IMHO prudent to assume that DJGPP doesn't yet support
locales and won't support them for an observable future.

> Of course, you are right. All the pertinent DJGPP libc functions
> work as you have described (they recognize CRLF *and* LF as '\n' if
> the file has been fopen()'ed in text mode) makeing the code I have
> added redundant and superfluous.

One caveat: can the files that are read as text have unprintable
characters, such as lone CRs or ^Z?  If they can, text mode is not
reliable enough to be used with such files.

> > Then the setmode() macro should take care of it.
> I will assume you are makeing reference to setmode() macro defined in lib/system.h.
> I will add a setmode() macro to system.h for djgpp:
> 1) DJGPP:
> # define setmode(fd, mode)      do { \
>                                   if (!isatty ((fd))) \
>                                     setmode ((fd), mode); \
>                                 } while (0)

This will only DTRT if this macro is called _only_ for switching
stdin/stdout to binary mode and back.  If you ever call the macro on a
handle other than 0 or 1, it might silently do nothing without a good
reason.

It is okay to do this if you _know_ setmode will only be invoked on
stdin/stdout, but I'd suggest a prominent comment to that effect where
the macro is defined, lest someone forgets this caveat.

- Raw text -


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