Re: VS 2015 support in src/tools/msvc - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: VS 2015 support in src/tools/msvc
Date
Msg-id CAB7nPqROXyB_=-BbAXGnCdHFYUE4_+qgQAGk1swwnVQSfiab9Q@mail.gmail.com
Whole thread Raw
In response to Re: VS 2015 support in src/tools/msvc  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: VS 2015 support in src/tools/msvc  (Magnus Hagander <magnus@hagander.net>)
Re: VS 2015 support in src/tools/msvc  (Christian Ullrich <chris@chrullrich.net>)
List pgsql-hackers
On Fri, Apr 8, 2016 at 10:05 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
¥> On 04/08/2016 07:15 AM, Christian Ullrich wrote:
>> GetLocaleInfoEx() is covered by #if (WINVER >= 0x0600), we define
>> _WIN32_WINNT as 0x0501 (src/include/port/win32.h) and WINVER inherits that
>> value.

Yes, I had a look at winnls.h and that's true.

>> Michael, none of your patches change this, so how does it ever build on
>> your system?

Luck. I am getting a warning but the code is able to somewhat compile:
  src/port/chklocale.c(230): warning C4013: 'GetLocaleInfoEx'
undefined; assuming extern returning int
[C:\Users\IEUser\git\postgres\libpgport.vcxproj]
But that's clearly incorrect to get that. As you are saying, what we
actually just need to do is bumping _WIN32_WINNT to 0x0600 when
compiling with VS2015, meaning that the minimum build requirement for
Postgres with VS2015 would be Windows Vista, and it would not be
possible to compile it on XP or Windows server 2k3. As XP is already
out of support, I think that this is an acceptable tradeoff, and it
would still be possible to build Postgres on XP with older versions of
Visual. Thoughts?

> OK, at this stage it appears to me that if today is the deadline for getting
> this in for 9.6 then it's going to be missed.

Really? I thought that new VS support were done on HEAD and the last
stable version, aka 9.5 here. This was what was done previously for
VS2012 and VS2013.

> And no, Michael's suggested inclusion didn't help, probably for the reasons
> Christian suggests.

Yes.

List of _WIN32_WINNT is here:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx
And here is the compatibility grid of VS2015 with existing Windows OSes:
https://www.visualstudio.com/en-us/products/visual-studio-2015-compatibility-vs.aspx

Anyway, attached are updated patches. This makes the warning go away
from my side, so I guess that it should allow Andrew to compile the
code.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Lower msvc build verbosity level
Next
From: Magnus Hagander
Date:
Subject: Re: VS 2015 support in src/tools/msvc