Re: VS 2015 support in src/tools/msvc - Mailing list pgsql-hackers

From Tom Lane
Subject Re: VS 2015 support in src/tools/msvc
Date
Msg-id 26249.1461904772@sss.pgh.pa.us
Whole thread Raw
In response to Re: VS 2015 support in src/tools/msvc  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: VS 2015 support in src/tools/msvc
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: UNION ALL - Var attno
Next
From: sri harsha
Date:
Subject: Re: UNION ALL - Var attno