Re: PG compilation error with Visual Studio 2015/2017/2019 - Mailing list pgsql-hackers

From Juan José Santamaría Flecha
Subject Re: PG compilation error with Visual Studio 2015/2017/2019
Date
Msg-id CAC+AXB2uv36fbZC7jeCMuLzxycwM+Pkqgqe34Jq-jHknbuDy+A@mail.gmail.com
Whole thread Raw
In response to Re: PG compilation error with Visual Studio 2015/2017/2019  (davinder singh <davindersingh2692@gmail.com>)
Responses Re: PG compilation error with Visual Studio 2015/2017/2019
Re: PG compilation error with Visual Studio 2015/2017/2019
List pgsql-hackers

On Tue, Apr 7, 2020 at 7:44 AM davinder singh <davindersingh2692@gmail.com> wrote:

You need to enable NLS support in the config file. Let me know if that answers your question.

Yes, I can see where this is coming from now, thanks.

Currently, it is using _create_locale it behaves similarly to GetLocaleInfoEx i.e. it also only checks the format only difference is for a bigger set.
I thought of using GetLocaleInfoEx for the fix because it behaves similarly to the already existing and a similar issue was resolved earlier using the same. I have attached the patch, let me know your thoughts.

You are right, that the way to get the locale name information is through GetLocaleInfoEx().

A couple of comments on the patch:

* I think you could save a couple of code lines, and make it clearer, by merging both tests on  _MSC_VER  into a single #if... #else and leaving as common code:
+ }
+ else
+ return NULL;
+#endif /*_MSC_VER && _MSC_VER < 1900*/

* The logic on "defined(_MSC_VER) && (_MSC_VER >= 1900)" is defined as "_WIN32_WINNT >= 0x0600" on other parts of the code. I would recommend using the later.

* This looks like a spurious change: 
 - sizeof(iso_lc_messages), NULL);
+ sizeof(iso_lc_messages), NULL);

Regards,

Juan José Santamaría Flecha

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal \gcsv
Next
From: Tom Lane
Date:
Subject: Re: A bug when use get_bit() function for a long bytea string