]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix the MSVC build for versions 2015 and later.
authorAmit Kapila <akapila@postgresql.org>
Thu, 14 May 2020 04:04:46 +0000 (09:34 +0530)
committerAmit Kapila <akapila@postgresql.org>
Thu, 14 May 2020 04:04:46 +0000 (09:34 +0530)
commit98171e59a6cae02b5efdbf6de12bc630d58373c6
tree4bf8776305c08dd0f10296951d3c30f083317dd5
parent73a5c0d81ea611ad59051fe52a4b9e72b9e90289
Fix the MSVC build for versions 2015 and later.

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 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.

In passing, change the documentation references of the now obsolete links.

Note that this problem occurs only with NLS enabled builds.

Author: Juan José Santamaría Flecha, Davinder Singh and Amit Kapila
Reviewed-by: Ranier Vilela and Amit Kapila
Backpatch-through: 9.5
Discussion: https://postgr.es/m/CAHzhFSFoJEWezR96um4-rg5W6m2Rj9Ud2CNZvV4NWc9tXV7aXQ@mail.gmail.com
src/backend/utils/adt/pg_locale.c