Re: PG compilation error with Visual Studio 2015/2017/2019

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, davinder singh <davindersingh2692(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PG compilation error with Visual Studio 2015/2017/2019
Date: 2020-05-07 05:51:04
Message-ID: CAA4eK1JzXPvEwTOnUv24vWqZeSJxsVzrSfL+GxxBoXcMU-OZ7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 6, 2020 at 11:01 PM Juan José Santamaría Flecha
<juanjo(dot)santamaria(at)gmail(dot)com> wrote:
>
> On Wed, May 6, 2020 at 6:41 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>>
>> On Wed, May 6, 2020 at 4:19 AM Juan José Santamaría Flecha
>> >
>> > I think that the definition of get_iso_localename() should be consistent across all versions, that is HEAD like back-patched.
>> >
>>
>> Fair enough. I have changed such that get_iso_localename is the same
>> in HEAD as it is backbranch patches. I have attached backbranch
>> patches for the ease of verification.
>
>
> LGTM, and I see no regression in the manual SQL tests, so no further comments from my part.
>

Thanks, Juan and Davinder for verifying the latest patches. I think
this patch is ready to commit unless someone else has any comments. I
will commit and backpatch this early next week (probably on Monday)
unless I see more comments.

To summarize, this is a longstanding issue of Windows build (NLS
enabled builds) for Visual Studio 2015 and later releases. Visual
Studio 2015 and later versions should still be able to do the same as
Visual Studio 2012, but the declaration of locale_name is missing in
_locale_t, causing the code compilation to fail, hence this patch
falls back
instead on to enumerating all system locales by using
EnumSystemLocalesEx to find the required locale name. If the input
argument is in Unix-style then we can get ISO Locale name directly by
using GetLocaleInfoEx() with LCType as LOCALE_SNAME.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-05-07 06:25:24 Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators
Previous Message Michael Paquier 2020-05-07 05:45:44 Re: Postgres Windows build system doesn't work with python installed in Program Files