Re: back branches vs. VS 2008

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: back branches vs. VS 2008
Date: 2011-01-04 09:43:20
Message-ID: AANLkTi=nXSE8GjXPXhB3XQ8bFoiWMhYsYuY_bxere=FW@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 4, 2011 at 04:49, Andrew Dunstan <andrew(at)dunslane(dot)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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2011-01-04 09:44:32 Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
Previous Message Tatsuo Ishii 2011-01-04 09:07:41 Re: regclass without error?