This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: DOS/Windows-specific code: source.c
- To: DJ Delorie <dj at redhat dot com>
- Subject: Re: DOS/Windows-specific code: source.c
- From: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Date: Wed, 9 May 2001 13:07:39 +0300 (IDT)
- cc: gdb at sources dot redhat dot com
On 8 May 2001, DJ Delorie wrote:
> "Eli Zaretskii" <eliz@is.elta.co.il> writes:
> > Perhaps, but this is not the problem I was trying to solve. The issue
> > is whether _any_ platform needs to put O_BINARY into mode in this
>
> If it's host-specific code, perhaps. But it's better if nobody needs
> to know whether or not O_BINARY is available; they only need to know
> if it's *appropriate*. If the file is binary, use O_BINARY. If it is
> text, don't.
This is what GDB does already. This specific case is special because
_WIN32 build wanted to read text files with O_BINARY, due to the
problems with using byte offsets to record where each line begins.
I suggest removing that snippet, because CRLF_SOURCE_FILES already
solves the same problem in a more elegant way. The DJGPP port uses
that since at least GDB 4.18, so native Windows ports should also be
happy with it.