Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoh34-0005AJ-7m for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Apr 2016 00:46:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aoh33-0002z0-BE for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Apr 2016 00:46:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aoh32-0002yI-61 for pgsql-hackers@postgresql.org; Sat, 09 Apr 2016 00:46:48 +0000 Received: from mail-ig0-x22b.google.com ([2607:f8b0:4001:c05::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1aoh2x-0005Kc-NL for pgsql-hackers@postgresql.org; Sat, 09 Apr 2016 00:46:47 +0000 Received: by mail-ig0-x22b.google.com with SMTP id kb1so47291901igb.0 for ; Fri, 08 Apr 2016 17:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=tYsw6aRM0VItX7VO2Aito90OMLSL5Rn8xCRswTGu9nA=; b=x6NWEv/edSjNqeUBpnxyRCMXJeRy5yFisRP5KSm7qpnEuACMoo7lRV25SnBW70PW8V mmvmHLz5bWIDIgTu72Uq1CqE+PVOZzP2N43tQ+qrSQdzLdl6auK+/iOJbZSsr+M1M6d8 p92P4/L/xBegjKTafPEWzvWjzAOzPP2pSAd5P0V3A09diVd0KBOcC6Y0isiP7LmPuryN bUrplj0PvORmfv8xtvXwX7Ki55u4c3eWb+9DyVmXyHA/mRoX0faQN12/MqxPtSin036u QAd7fJacSpZzw57veC4e29ErKB+L6AvK9Cnr8+udr1no6y/CHHtedbOAwIdTy7jchhku Zbdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=tYsw6aRM0VItX7VO2Aito90OMLSL5Rn8xCRswTGu9nA=; b=IAIgcW+xEq5otsmGyRMAK/Qf6EOHCDQ8Yxz3ldDTUsrfAeKsAjGojn6fOoE1pZKGPo CqP2BwdU5fe8aoFW6XukYR1lsitzLL05kZaL1LRvQ0vSg9trUyy1lyzlGqtBOrUQmfFz tjRbRlyk+KIXyQ6KKJgqZYAEaxJjeXiXRhNwuEC5IXIgXCFA9ibPXQddVfW2vcNoZ+FS blrB24D3BtcTrKA9UiOKiqrs4+Ne6kF7Y+cxsoej8dZ8Q1R2kY7glmIuN5Dn9ozo1r7o ioUp0Y7VKuSSB4E4EEIBWNXTV/trVswguRXTRaj8ln7dbhJQ8fYwisiSQvGkt3PXSNop Pj1g== X-Gm-Message-State: AD7BkJJUrIyAPj6qkWdPHo7M6mzxomD3GCF7oJjW0M2NXrHShM2Y+uyecuTfQ+dpgEaU2KMlygLmh012CV+Xu6ObmORKBzlaugZWsYZ/xgTuDqnkXssmvozCG+pnfJXJ/Y5snWuG4T+mrhbqjO2sRhjtgw7tSQ/QbQCa3YP2RoFihlhkljkbdFG6ZVFjYL2XIA== X-Received: by 10.50.92.37 with SMTP id cj5mr7025793igb.91.1460162801612; Fri, 08 Apr 2016 17:46:41 -0700 (PDT) Received: from [172.16.2.84] ([209.116.65.82]) by smtp.gmail.com with ESMTPSA id b33sm8287764iod.10.2016.04.08.17.46.33 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Apr 2016 17:46:40 -0700 (PDT) Subject: Re: VS 2015 support in src/tools/msvc To: Michael Paquier , Christian Ullrich References: <56F53382.3060508@dunslane.net> <56FA9FDF.20108@2ndquadrant.com> <56FB2BF8.3060303@dunslane.net> <5705768E.4020908@dunslane.net> <5706FB7E.5070703@dunslane.net> <570792ED.2080003@chrullrich.net> <5707AC9E.7070309@dunslane.net> <5707C80F.9050709@chrullrich.net> <5707D7DC.2030508@dunslane.net> <5707E074.4030102@chrullrich.net> Cc: Andrew Dunstan , Robert Haas , Tom Lane , Magnus Hagander , PostgreSQL mailing lists From: Petr Jelinek Message-ID: <570850E3.7090009@2ndquadrant.com> Date: Sat, 9 Apr 2016 02:46:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 09/04/16 00:41, Michael Paquier wrote: > On Sat, Apr 9, 2016 at 1:46 AM, Christian Ullrich 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers