Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aw7KF-0002UP-Mj for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Apr 2016 12:15:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aw7KE-0004KH-S2 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Apr 2016 12:15:14 +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 1aw7Iu-0002VM-3P for pgsql-hackers@postgresql.org; Fri, 29 Apr 2016 12:13:52 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aw7Ir-0004zF-3N for pgsql-hackers@postgresql.org; Fri, 29 Apr 2016 12:13:51 +0000 Received: from mfilter14-d.gandi.net (mfilter14-d.gandi.net [217.70.178.142]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 010B8A8106; Fri, 29 Apr 2016 14:13:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter14-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter14-d.gandi.net (mfilter14-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 8hmfu0-8tOh4; Fri, 29 Apr 2016 14:13:45 +0200 (CEST) X-Originating-IP: 98.122.164.227 Received: from [192.168.10.146] (unknown [98.122.164.227]) (Authenticated sender: adsend@dunslane.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 95D02A80C7; Fri, 29 Apr 2016 14:13:43 +0200 (CEST) Subject: Re: VS 2015 support in src/tools/msvc To: Tom Lane References: <0B77CFCB-0F90-4CAB-8509-7EB391C06D59@chrullrich.net> <570A6A14.6040303@dunslane.net> <570A9FCE.5040201@chrullrich.net> <570ABFA0.4090403@2ndquadrant.com> <57192C59.9090903@dunslane.net> <571BD6D4.9@dunslane.net> <17239.1461448469@sss.pgh.pa.us> <10891.1461450795@sss.pgh.pa.us> <571C3CA6.5070803@dunslane.net> <571CE6DC.9010501@dunslane.net> <5722DFC5.1080100@dunslane.net> <26249.1461904772@sss.pgh.pa.us> Cc: Michael Paquier , Christian Ullrich , Petr Jelinek , Robert Haas , Magnus Hagander , PostgreSQL mailing lists From: Andrew Dunstan Message-ID: <57234FF6.90905@dunslane.net> Date: Fri, 29 Apr 2016 08:13:42 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <26249.1461904772@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; 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 04/29/2016 12:39 AM, Tom Lane wrote: > Andrew Dunstan writes: >> latest patch attached. I have also cleaned up the docs some, and removed >> references to the now redundant msysGit. > Please don't do stuff like this: > > @@ -232,6 +265,10 @@ win32_langinfo(const char *ctype) > if (r != NULL) > sprintf(r, "CP%s", codepage); > } > + > +#if (_MSC_VER >= 1900) > + } > +#endif > #endif > > return r; > > I'm not very sure what pgindent will do with conditionally-included > indentation, but it's unlikely to be pleasing. > > In this particular case, you could probably fix it by making the > other end of that be > > + if (GetLocaleInfoEx(wctype, > + LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, > + (LPWSTR) &cp, sizeof(cp) / sizeof(WCHAR)) > 0) > + { > + r = malloc(16); /* excess */ > + if (r != NULL) > + sprintf(r, "CP%u", cp); > + } > + else > +#endif > + { > + > > and omitting the #if/#endif around the trailing }. > > Yeah, I noticed the ugliness, should have fixed it. Applied your fix and committed. cheers andrew -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers