Re: VS 2015 support in src/tools/msvc

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Christian Ullrich <chris(at)chrullrich(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VS 2015 support in src/tools/msvc
Date: 2016-04-09 00:46:27
Message-ID: 570850E3.7090009@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/04/16 00:41, Michael Paquier wrote:
> On Sat, Apr 9, 2016 at 1:46 AM, Christian Ullrich <chris(at)chrullrich(dot)net> wrote:
>> * Andrew Dunstan wrote:
>>
>>> On 04/08/2016 11:02 AM, Christian Ullrich wrote:
>>
>>
>>>> src/port/chklocale.c(233): warning C4133: 'function': incompatible
>>>> types - from 'const char *' to 'LPCWSTR' [...\postgres.vcxproj]
>>
>>
>>> Do you have a fix for the LPCWSTR parameter issue?
>>
>>
>> As long as the locale short name cannot contain characters outside of ASCII,
>> and I don't see how it could, just the typical measure-allocate-convert
>> dance, add error handling to taste:
>>
>> int res = MultiByteToWideChar(CP_ACP, 0, ctype, -1, NULL, 0);
>> WCHAR *wctype = malloc(res * sizeof(WCHAR));
>> memset(wctype, 0, res * sizeof(WCHAR));
>> res = MultiByteToWideChar(CP_ACP, 0, ctype, -1, wctype, wctypelen);
>>
>> If it is somehow guaranteed that ctype is only the most basic short name
>> ("xx-YY") with no code pages or anything, it becomes much simpler, of
>> course, and I would just use a loop.
>>
>> If the locale name can contain characters above 0x7f, we'd have to know the
>> code page of the string we use to get the code page.
>
> Could somebody give a try instead of me? I could take a look on it,
> but just in 12 hours or so, aka after the deadline if that matters for
> this patch.
>

I won't be able to get back to it (well mainly to windows environment)
till Thursday due to travel, sorry.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2016-04-09 00:49:57 Re: closing CommitFest 2016-03, feature freeze now in effect
Previous Message Robert Haas 2016-04-09 00:05:25 closing CommitFest 2016-03, feature freeze now in effect