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-05 11:34:24
Message-ID: CAA4eK1KsU5TV_ypLHZsok7LvqJLg1WSPsjcf2BR0a_Q5BuD9mw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 4, 2020 at 6:59 PM Juan José Santamaría Flecha
<juanjo(dot)santamaria(at)gmail(dot)com> wrote:
>
> On Thu, Apr 30, 2020 at 5:07 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>>
>>
>> Okay, thanks. The key point to keep in mind is to avoid touching the
>> code related to prior MSVC versions as we might not have set up to
>> test those.
>
>
> Please find attached a new version following this approach.
>

Thanks for the new version. I have found few problems and made
changes accordingly. In back-branch patches, I found one major
problem.

+#if (_MSC_VER >= 1900) /* Visual Studio 2015 or later */
+ rc = get_iso_localename(winlocname, iso_lc_messages);
+#else

Here, we need to free loct, otherwise, it will leak each time this
function is called on a newer MSVC version. Also, call to
_create_locale is redundant in _MSC_VER >= 1900. So, I have tried to
write it differently, see what do you think about it?

*
+ * BEWARE: this function is WIN32 specific, so wchar_t are UTF-16.
I am not sure how much relevant is this comment so removed for now.

Apart from that, I have made a few other changes in comments, fixed
typos, and ran pgindent. Let me know what do you think of attached
patches?

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

Attachment Content-Type Size
0001-PG-compilation-error-with-VS-2015-2017-2019_v16.patch application/octet-stream 9.0 KB
0001-PG_10-compilation-error-with-VS-2015-2017-2019_v16.patch application/octet-stream 8.3 KB
0001-PG9_5-compilation-error-with-VS-2015-2017-2019_v16.patch application/octet-stream 8.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleksandr Shulgin 2020-05-05 11:39:46 Re: Poll: are people okay with function/operator table redesign?
Previous Message Amit Kapila 2020-05-05 10:44:02 Re: WAL usage calculation patch