Re: VS 2015 support in src/tools/msvc

From: Christian Ullrich <chris(at)chrullrich(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VS 2015 support in src/tools/msvc
Date: 2016-04-24 19:29:30
Message-ID: d4c1916b-56de-c594-3dba-03cf550bc778@chrullrich.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Andrew Dunstan wrote:

> OK, here's my final version of the patch, which I will apply in 24 hours
> or so unless there is an objection.

+ <productname>Visual Studio 2008</productname> and above. Compilation
+ is supported down to <productname>Windows XP</productname> and
+ <productname>Windows Server 2003</> when building with
+ <productname>Visual Studio 2005</> to
+ <productname>Visual Studio 2013</productname>. Building with
+ <productname>Visual Studio 2015</productname> is supported down to
+ <productname>Windows Vista</> and <productname>Windows Server
2008</>.

This paragraph contradicts itself; it first says 2008 is the minimum
version, right after that it supports 2005, too. The last version of
Visual Studio that will install on XP, 2003, Vista, and 2008 is VS 2010
anyway, anything released after that requires at least 7/2008R2.

I would actually just say "is supported with Visual Studio 2005 [or
possibly 2008] and higher" instead of listing versions. I don't think we
need to recapitulate the system requirements of individual VS releases
and anyone trying to install 2012+ on Vista will quickly find out it
doesn't work. It would be different if we actually excluded particular
VS versions or VS/OS combinations that are supported by VS itself, but
we don't.

+ /*
+ * get a pointer sized version of bgchild to avoid
warnings about
+ * casting to a different size on WIN64.
+ */
+ intptr_t bgchild_handle = bgchild;

If you're going to copy it anyway, why not just use a HANDLE rather than
cast it again later? It's only used in two places, cast to HANDLE in
both, and the special case of -1 does not matter in either.

+ * Leave a higher value in place. When building with at least Visual
+ * Studio 2015 the minimum requirement is Windows Vista (0x0600) to
+ * get support for GetLocaleInfoEx() with locales. For everything else
+ * the minumum version os Windows XP (0x0501).

s/os/is/ in the last line.

This one doesn't matter, but just for perfection's sake:

+#if (_MSC_VER >= 1900)
+ uint32 cp;
+ WCHAR wctype[80];
+
+ memset(wctype, 0, 80 * sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, ctype, -1, wctype, 80);

The maximum length is documented as 85 characters, also:

<https://msdn.microsoft.com/en-us/library/windows/desktop/dd373815(v=vs.85).aspx>:
'Note Your application must use the constant [LOCALE_NAME_MAX_LENGTH]
for the maximum locale name length, instead of hard-coding the value "85".'

--
Christian

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-04-24 19:43:56 Re: Why doesn't src/backend/port/win32/socket.c implement bind()?
Previous Message Christian Ullrich 2016-04-24 19:27:32 Re: VS 2015 support in src/tools/msvc