List Archive

Thread

Thread Index

Message

From: "Lubomir I. Ivanov" <neolit123%gmail.com@localhost>
To: Thomas Klausner <tk%giga.or.at@localhost>
Subject: Re: MinGW-w64 build failure with 1.3.1 and 1.3.2
Date: Mon, 20 Nov 2017 14:31:16 +0200

On 20 November 2017 at 14:16, Thomas Klausner <tk%giga.or.at@localhost> wrote:
>
> 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?

#ifdef __MINGW32__

but there is no such thing as /dev/urandom on Windows, so maybe this
open() call was reached by mistake.

lubomir
--

Made by MHonArc.