[MPlayer-dev-eng] MinGW hack in libaf/Makefile

Rich Felker dalias at aerifal.cx
Tue Mar 20 16:39:59 CET 2007


On Tue, Mar 20, 2007 at 10:38:59AM +0100, Diego Biurrun wrote:
> > > It appears that on MinGW unistd.h includes io.h, which has a conflicting
> > > declaration for open.  There are essentially two ways to fix this:
> > > 
> > > 1) Remove the #include <unistd.h>, it does not appear to be needed, at
> > >    least on Linux.
> > > 2) Rename open to af_open.
> > > 
> > > Probably doing both is the right solution.  Only one file (af_export.c)
> > > appears to need unistd.h and there open has already been renamed to
> > > af_open.
> > > 
> > > So unless there are any objections I'll go ahead and do that.
> > 
> > While I don't object (I prefer solution 1 but 1+2 is ok), it's wrong
> > for unistd.h to define open at all. Only fcntl.h should define open.
> > We should send bug reports upstream.
> 
> The problem is that one filter (af_export) includes fcntl.h.  There open
> has been renamed to af_open already.  So we might as well be consistent.

IMO not. This is a very rare and special case (and probably one that
should never have been added in the first place). No need to rename
functions in tons of other files because a hackish special case
requires it. Aside from af_export, all the filters are plain C code,
not posix/unix-dependent stuff, so there's no reason they should avoid
the posix function name open.

Rich



More information about the MPlayer-dev-eng mailing list