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-04-29 12:27:22 |
Message-ID: | CAA4eK1L-rQZUKfCV4_7AvZcW3DEO_OBeAaRPMK1Hx+52mcoVHQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Apr 28, 2020 at 11:39 PM Juan José Santamaría Flecha
<juanjo(dot)santamaria(at)gmail(dot)com> wrote:
>
>
> On Mon, Apr 27, 2020 at 1:20 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>>
>> I think we should backpatch this till 9.5 as I could see the changes
>> made by commit 0fb54de9 to support MSVC2015 are present in that branch
>> and the same is mentioned in the commit message. Would you like to
>> prepare patches (and test those) for back-branches?
>
>
> I do not have means to test these patches using Visual Studio previous to 2012, but please find attached patches for 9.5-9.6 and 10-11-12 as of version 14. The extension is 'txt' not to break the cfbot.
>
I see some problems with these patches.
1.
+ loct = _create_locale(LC_CTYPE, winlocname);
+ if (loct != NULL)
+ {
+ lcid = loct->locinfo->lc_handle[LC_CTYPE];
+ if (lcid == 0)
+ lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
+ _free_locale(loct);
+ }
if (!GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, isolang, sizeof(isolang)))
return NULL;
if (!GetLocaleInfoA(lcid, LOCALE_SISO3166CTRYNAME, isocrty, sizeof(isocrty)))
return NULL;
In the above change even if loct is NULL, we call GetLocaleInfoA()
which is wrong and the same is not a problem without the patch.
2. I think the code in IsoLocaleName is quite confusing and difficult
to understand in back branches and the changes due to this bug-fix
made it more complicated. I am thinking to refactor it such that the
code for (_MSC_VER >= 1700 && _MSC_VER < 1900), (_MSC_VER >= 1900)
and last #else code (the code for version < 17) resides in their own
functions. That might make this function easier to understand, what
do you think?
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2020-04-29 12:32:57 | Re: PG compilation error with Visual Studio 2015/2017/2019 |
Previous Message | Daniel Gustafsson | 2020-04-29 11:57:49 | Re: Improve errors when setting incorrect bounds for SSL protocols |