Re: back branches vs. VS 2008 - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: back branches vs. VS 2008
Date
Msg-id AANLkTi=nXSE8GjXPXhB3XQ8bFoiWMhYsYuY_bxere=FW@mail.gmail.com
Whole thread Raw
In response to Re: back branches vs. VS 2008  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: back branches vs. VS 2008  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Tue, Jan 4, 2011 at 04:49, Andrew Dunstan <andrew@dunslane.net> wrote:
>
> On 01/03/2011 12:15 PM, I wrote:
>>
>> The following patch allows me to build the 8.3 and 8.4 branches using
>> Visual Studio 2008, once the build system is patched. But I don't really
>> know why. HEAD and 9.0 build fine without it. But those branches branches
>> fail with a complaint about IPPROTO_IPV6 being undefined.
>>
>> The patch seems harmless enough. But I'd like to know why it's happening.
>> Does anyone have a clue?
>>
>>
>> -#ifdef IPV6_V6ONLY
>> +#if defined(IPV6_V6ONLY) && defined(IPPROTO_IPV6)
>>        if (addr->ai_family == AF_INET6)
>>        {
>>            if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY,
>
>
> OK, what's going here is that, in the newer SDK, IPV6_V6ONLY is defined
> unconditionally, but IPPROTO_IPV6 is only defined if _WIN32_WINNT is set to
> 0x0501 or higher. We defined _WIN32_WINNT as 0x0500 until 9.0, when we
> changed it specifically to allow use of the right IPV6 settings.

I wonder if anything else changed with that #define, though.


> This seems to me like a clear error in the MS headers. I don't think it
> makes any sense to define the settings constant but not the context
> constant. The fix I have suggested above doesn't seem unreasonable or
> terribly unsafe in these circumstances. The code clearly contemplates the
> setsockopt() call in question not having been run, as shown in this comment:

Yeah, it seems reasonable - I assume you tested it and it doesn't fail
in some *different* way than the one we expect in the code?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: regclass without error?
Next
From: Greg Smith
Date:
Subject: Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid