From: | Noah Misch <noah(at)leadboat(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Petr Jelinek <petr(at)2ndquadrant(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-03-09 04:31:37 |
Message-ID: | 20160309043137.GA933917@tornado.leadboat.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Mar 08, 2016 at 10:32:28PM +0900, Michael Paquier wrote:
> Subject: [PATCH 3/4] Fix use of locales for VS 2015
>
> lc_codepage is a flag missing from locale.h, causing this code path
> introduced in VS 2012 to fail. Perhaps there is a reason for this field
> to have been clobbered, but let's fall back to the pre-VS-2012 code
> parsing directly LC_TYPE to get the codepage wanted.
> ---
> src/port/chklocale.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/src/port/chklocale.c b/src/port/chklocale.c
> index a551fdc..a7d88fb 100644
> --- a/src/port/chklocale.c
> +++ b/src/port/chklocale.c
> @@ -203,7 +203,16 @@ win32_langinfo(const char *ctype)
> {
> char *r = NULL;
>
> -#if (_MSC_VER >= 1700)
> + /*
> + * lc_codepage is correctly declared in Visual Studio 2012 and 2013.
> + * However in VS 2015 this flag is missing from locale.h, visibly this
> + * is an error of refactoring from Microsoft that is at the origin of
> + * this missing field, causing a compilation failure in this code path.
> + * Hence, it is more reliable to fall back to other code path grabbing
No, the other path can't handle a "locale name" like "initdb --locale=th-TH".
That makes the other code path inadequate for VS2012 and later. See the
IsoLocaleName() header comment.
> + * the codepage from the ctype name itself. If VS gets back this field
> + * in the future, we may want to relax the use of _create_locale here.
> + */
> +#if (_MSC_VER >= 1700) && (_MSC_VER <= 1800)
> _locale_t loct = NULL;
>
> loct = _create_locale(LC_CTYPE, ctype);
From | Date | Subject | |
---|---|---|---|
Next Message | Christian Ullrich | 2016-03-09 04:48:08 | Re: Crash with old Windows on new CPU |
Previous Message | Andreas Karlsson | 2016-03-09 03:43:19 | Re: Is there a way around function search_path killing SQL function inlining? |