Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1adVo5-0005BZ-Px for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Mar 2016 04:33:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1adVo4-0005az-NP for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Mar 2016 04:33:08 +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) (envelope-from ) id 1adVmj-00041q-VA for pgsql-hackers@postgresql.org; Wed, 09 Mar 2016 04:31:46 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1adVmg-0004Xk-EB for pgsql-hackers@postgresql.org; Wed, 09 Mar 2016 04:31:45 +0000 Received: by mail-pa0-x235.google.com with SMTP id fe3so13147996pab.1 for ; Tue, 08 Mar 2016 20:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=o6HzTtJjmYCmgI2sBxFpiQZ2FjONLdQ1oDAyhe1cSlM=; b=JusEneUBYFFx+LS6VQp4gmS4aDexCB7M8x3PVSbs3dAEemeqsULqJ5Zi8YHK9cGXS8 7C9PJr0d6gKGa8Upud6eon1UeZIKQypmztW2k5+AYznSf+s8zNa+BmiQm5GOc6Yl4viO U7A34FYr3yrGUlyLoCfa4AxlW5mvXN0eVRnro= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=o6HzTtJjmYCmgI2sBxFpiQZ2FjONLdQ1oDAyhe1cSlM=; b=EdHK5axHXDb2pIj8bZ0Poqr728sH1X+YtoVyZJXaMh2VaU6DpB2ulmfAZGyHP4uvgv HzmTMPGv/8uEWI7ZaWCJQ5ZhfLh9ReSlGU83gFliS/oXOzJdkS01ahwBWt2EzStbUQwP gjOmCtdANSuOi3w8smF2efejrhv/esoTa3mFgshGkM9CCtk/juySSgLbQNRPtA5GNGuc WtloZvZsGe+TYyLKry5a7VKRVldGG+YFsHryOHdbeQHESbX7n37fNadS7RrgUMavR38m m7vJp2Td5uIyfMRUAe2dMbZh67yyH9J2CiM/QbVIkHtts1Yc7GdXuGTGQzejSs6VoCkS FSZA== X-Gm-Message-State: AD7BkJLlouwGpOG63DHMQ0W5+lSDsX2TKqaaSP6rLhwdpn8rPXWf3vCn+ylrZVRixybkRQ== X-Received: by 10.66.153.44 with SMTP id vd12mr46598739pab.82.1457497899706; Tue, 08 Mar 2016 20:31:39 -0800 (PST) Received: from tornado.leadboat.com (c-98-248-47-228.hsd1.ca.comcast.net. [98.248.47.228]) by smtp.gmail.com with ESMTPSA id b4sm8406980pas.19.2016.03.08.20.31.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Mar 2016 20:31:39 -0800 (PST) Date: Tue, 8 Mar 2016 23:31:37 -0500 From: Noah Misch To: Michael Paquier Cc: Andrew Dunstan , Tom Lane , Petr Jelinek , Magnus Hagander , PostgreSQL mailing lists Subject: Re: VS 2015 support in src/tools/msvc Message-ID: <20160309043137.GA933917@tornado.leadboat.com> References: <56DA6394.9040404@2ndquadrant.com> <15559.1457156815@sss.pgh.pa.us> <56DAEE74.3010604@dunslane.net> <56DB47A5.7040502@dunslane.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Pg-Spam-Score: -2.7 (--) 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 Tue, Mar 08, 2016 at 10:32:28PM +0900, Michael Paquier wrote: > Subject: [PATCH 3/4] Fix use of locales for VS 2015 > > lc_codepage is a flag missing from locale.h, causing this code path > introduced in VS 2012 to fail. Perhaps there is a reason for this field > to have been clobbered, but let's fall back to the pre-VS-2012 code > parsing directly LC_TYPE to get the codepage wanted. > --- > src/port/chklocale.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/src/port/chklocale.c b/src/port/chklocale.c > index a551fdc..a7d88fb 100644 > --- a/src/port/chklocale.c > +++ b/src/port/chklocale.c > @@ -203,7 +203,16 @@ win32_langinfo(const char *ctype) > { > char *r = NULL; > > -#if (_MSC_VER >= 1700) > + /* > + * lc_codepage is correctly declared in Visual Studio 2012 and 2013. > + * However in VS 2015 this flag is missing from locale.h, visibly this > + * is an error of refactoring from Microsoft that is at the origin of > + * this missing field, causing a compilation failure in this code path. > + * Hence, it is more reliable to fall back to other code path grabbing No, the other path can't handle a "locale name" like "initdb --locale=th-TH". That makes the other code path inadequate for VS2012 and later. See the IsoLocaleName() header comment. > + * the codepage from the ctype name itself. If VS gets back this field > + * in the future, we may want to relax the use of _create_locale here. > + */ > +#if (_MSC_VER >= 1700) && (_MSC_VER <= 1800) > _locale_t loct = NULL; > > loct = _create_locale(LC_CTYPE, ctype); -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers