Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aw0Ej-0005kG-BX for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Apr 2016 04:41:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aw0Ei-0002Lt-2T for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Apr 2016 04:41:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aw0DM-0000o5-MU for pgsql-hackers@postgresql.org; Fri, 29 Apr 2016 04:39:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aw0DK-0000KR-3r for pgsql-hackers@postgresql.org; Fri, 29 Apr 2016 04:39:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u3T4dWx6026250; Fri, 29 Apr 2016 00:39:32 -0400 From: Tom Lane To: Andrew Dunstan cc: Michael Paquier , Christian Ullrich , Petr Jelinek , Robert Haas , Magnus Hagander , PostgreSQL mailing lists Subject: Re: VS 2015 support in src/tools/msvc In-reply-to: <5722DFC5.1080100@dunslane.net> 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> Comments: In-reply-to Andrew Dunstan message dated "Fri, 29 Apr 2016 00:15:01 -0400" Date: Fri, 29 Apr 2016 00:39:32 -0400 Message-ID: <26249.1461904772@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) 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 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 }. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers