Re: VS 2015 support in src/tools/msvc

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Christian Ullrich <chris(at)chrullrich(dot)net>, 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-29 12:13:42
Message-ID: 57234FF6.90905@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/29/2016 12:39 AM, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> latest patch attached. I have also cleaned up the docs some, and removed
>> references to the now redundant msysGit.
> Please don't do stuff like this:
>
> @@ -232,6 +265,10 @@ win32_langinfo(const char *ctype)
> if (r != NULL)
> sprintf(r, "CP%s", codepage);
> }
> +
> +#if (_MSC_VER >= 1900)
> + }
> +#endif
> #endif
>
> return r;
>
> I'm not very sure what pgindent will do with conditionally-included
> indentation, but it's unlikely to be pleasing.
>
> In this particular case, you could probably fix it by making the
> other end of that be
>
> + if (GetLocaleInfoEx(wctype,
> + LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER,
> + (LPWSTR) &cp, sizeof(cp) / sizeof(WCHAR)) > 0)
> + {
> + r = malloc(16); /* excess */
> + if (r != NULL)
> + sprintf(r, "CP%u", cp);
> + }
> + else
> +#endif
> + {
> +
>
> and omitting the #if/#endif around the trailing }.
>
>

Yeah, I noticed the ugliness, should have fixed it. Applied your fix and
committed.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2016-04-29 13:03:37 Re: [sqlsmith] Failed assertion in BecomeLockGroupLeader
Previous Message Andrew Dunstan 2016-04-29 12:07:19 pgsql: Support building with Visual Studio 2015