List Archive

Thread

Thread Index

Message

From: Thomas Klausner <tk%giga.or.at@localhost>
To: Benjamin Gilbert <bgilbert%backtick.net@localhost>
Subject: Re: MinGW-w64 build failure with 1.3.1 and 1.3.2
Date: Mon, 20 Nov 2017 13:16:59 +0100

On Mon, Nov 20, 2017 at 07:11:29AM -0500, Benjamin Gilbert wrote:
> On Mon, Nov 20, 2017 at 7:07 AM, Thomas Klausner <tk%giga.or.at@localhost> 
> wrote:
> 
> > On Mon, Nov 20, 2017 at 06:53:31AM -0500, Benjamin Gilbert wrote:
> > > libzip 1.3.1 and 1.3.2 fail to build with MinGW-w64:
> > >
> > > nonrandomopentest.c: In function 'main':
> > > nonrandomopentest.c:51:39: error: macro "open" requires 3 arguments, but
> > > only 2 given
> > >      fd = open("/dev/urandom", O_RDONLY);
> >
> > This looks like a problem in MinGW. POSIX defines open like this:
> >
> > int open(const char *path, int oflag, ...)
> >
> > i.e. two arguments are required, more are allowed.
> 
> 
> True.  However, compat.h defines open like this:
> 
> #if defined(HAVE__OPEN)
> #define open(a, b, c)   _open((a), (b))
> #endif

Good point. Is MinGW's open() fine (file permissions, see comment
above that)? What would be the proper ifdef to check for MinGW and not
redefine open() there?
 Thomas

Made by MHonArc.