[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comparing binary files with Diff 3.2 compiled with MinGW
From: |
Bruno Haible |
Subject: |
Re: Comparing binary files with Diff 3.2 compiled with MinGW |
Date: |
Sat, 12 May 2012 23:19:50 +0200 |
User-agent: |
KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; ) |
Eli Zaretskii wrote:
> > > > > -# if defined __EMX__ || defined __DJGPP__ || defined __CYGWIN__
> > > > > +# if defined __EMX__ || defined __DJGPP__ || defined __CYGWIN__ ||
> > > > > defined __MINGW32__
> > > > > # include <io.h> /* declares setmode() */
> > > > > # else
> > > > > # define setmode _setmode
> > > >
> > > > What is the rationale/benefit for this proposed change?
> > >
> > > MinGW provides 'setmode' whose declaration is in io.h.
> >
> > But mingw's declaration of 'fileno' in stdio.h is not always enabled
> > (only if !defined _NO_OLDNAMES).
>
> _NO_OLDNAMES is undefined by default.
But it may be defined.
> > Therefore the #else branch is needed on mingw.
>
> That's okay, but then io.h should be included anyway, because it
> provides the prototype of _setmode as well. According to MSDN, the
> same is true for MSVC.
<io.h> is not needed here. When I add a use of setmode() to the unit test,
with the existing code, I do not get a warning about _setmode() being
undeclared - neither with mingw nor with MSVC. (Maybe this is because
<fcntl.h> already includes <io.h>.)
There is no need to change the code to #include a non-POSIX include file.
Bruno
Re: Comparing binary files with Diff 3.2 compiled with MinGW, Bruno Haible, 2012/05/12
Re: Comparing binary files with Diff 3.2 compiled with MinGW, Paul Eggert, 2012/05/12