diff --git a/misc.c b/misc.c index a28ae8f4..b2fc7719 100644 --- a/misc.c +++ b/misc.c @@ -238,28 +238,57 @@ char *buildinfo(const char *newline) strbuf_catf(buf, ", emulating "); #endif strbuf_catf(buf, "Visual Studio", newline); -#if _MSC_VER == 1900 - strbuf_catf(buf, " 2015 / MSVC++ 14.0"); + +#if 0 + /* + * List of _MSC_VER values and their translations taken from + * https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros + * except for 1920, which is not yet listed on that page as of + * 2019-03-22, and was determined experimentally by Sean Kain. + * + * The pointless #if 0 branch containing this comment is there so + * that every real clause can start with #elif and there's no + * anomalous first clause. That way the patch looks nicer when you + * add extra ones. + */ +#elif _MSC_VER == 1920 + strbuf_catf(buf, " 2019 (16.x)"); +#elif _MSC_VER == 1916 + strbuf_catf(buf, " 2017 version 15.9"); +#elif _MSC_VER == 1915 + strbuf_catf(buf, " 2017 version 15.8"); +#elif _MSC_VER == 1914 + strbuf_catf(buf, " 2017 version 15.7"); +#elif _MSC_VER == 1913 + strbuf_catf(buf, " 2017 version 15.6"); #elif _MSC_VER == 1912 - strbuf_catf(buf, " 2017 / MSVC++ 14.12"); + strbuf_catf(buf, " 2017 version 15.5"); +#elif _MSC_VER == 1911 + strbuf_catf(buf, " 2017 version 15.3"); +#elif _MSC_VER == 1910 + strbuf_catf(buf, " 2017 RTW (15.0)"); +#elif _MSC_VER == 1900 + strbuf_catf(buf, " 2015 (14.0)"); #elif _MSC_VER == 1800 - strbuf_catf(buf, " 2013 / MSVC++ 12.0"); + strbuf_catf(buf, " 2013 (12.0)"); #elif _MSC_VER == 1700 - strbuf_catf(buf, " 2012 / MSVC++ 11.0"); + strbuf_catf(buf, " 2012 (11.0)"); #elif _MSC_VER == 1600 - strbuf_catf(buf, " 2010 / MSVC++ 10.0"); + strbuf_catf(buf, " 2010 (10.0)"); #elif _MSC_VER == 1500 - strbuf_catf(buf, " 2008 / MSVC++ 9.0"); + strbuf_catf(buf, " 2008 (9.0)"); #elif _MSC_VER == 1400 - strbuf_catf(buf, " 2005 / MSVC++ 8.0"); + strbuf_catf(buf, " 2005 (8.0)"); #elif _MSC_VER == 1310 - strbuf_catf(buf, " 2003 / MSVC++ 7.1"); + strbuf_catf(buf, " .NET 2003 (7.1)"); #elif _MSC_VER == 1300 - strbuf_catf(buf, " 2003 / MSVC++ 7.0"); + strbuf_catf(buf, " .NET 2002 (7.0)"); +#elif _MSC_VER == 1200 + strbuf_catf(buf, " 6.0"); #else strbuf_catf(buf, ", unrecognised version"); #endif - strbuf_catf(buf, " (_MSC_VER=%d)", (int)_MSC_VER); + strbuf_catf(buf, ", _MSC_VER=%d", (int)_MSC_VER); #endif #ifdef BUILDINFO_GTK