updated Com_GetCompilerInfo to handle more MSVC versions

This commit is contained in:
myT 2024-08-07 03:40:57 +02:00
parent 6ed0ea19a8
commit 779b6dad92

View file

@ -3548,44 +3548,55 @@ static const char* Com_GetCompilerInfo()
#if defined( _MSC_VER )
typedef struct {
int mscVer;
const char* number;
const char* year;
const char* title;
} clVersion_t;
#define CL(MacroVersion, RealVersion, Year) { MacroVersion, RealVersion, Year }
#define CL(MacroVersion, Title) { MacroVersion, Title }
const clVersion_t clVersions[] = {
CL(1200, "6.0", ""),
CL(1300, "7.0", ".NET 2002"),
CL(1310, "7.1", ".NET 2003"),
CL(1400, "8.0", "2005"),
CL(1500, "9.0", "2005"),
CL(1600, "10.0", "2010"),
CL(1700, "11.0", "2012"),
CL(1800, "12.0", "2013"),
CL(1900, "14.0", "2015"),
CL(1910, "15.0", "2017 RTW"),
CL(1911, "15.3", "2017"),
CL(1912, "15.5", "2017"),
CL(1913, "15.6", "2017"),
CL(1914, "15.7", "2017"),
CL(1915, "15.8", "2017"),
CL(1916, "15.9", "2017"),
CL(1920, "16.0", "2019 RTW"),
CL(1921, "16.1", "2019"),
CL(1922, "16.2", "2019"),
CL(1923, "16.3", "2019"),
CL(1924, "16.4", "2019"),
CL(1925, "16.5", "2019"),
CL(1926, "16.6", "2019"),
CL(1927, "16.7", "2019"),
CL(1928, "16.8", "2019")
CL(1200, "6.0"),
CL(1300, ".NET 2002 (7.0)"),
CL(1310, ".NET 2003 (7.1)"),
CL(1400, "2005 (8.0)"),
CL(1500, "2008 (9.0)"),
CL(1600, "2010 (10.0)"),
CL(1700, "2012 (11.0)"),
CL(1800, "2013 (12.0)"),
CL(1900, "2015 (14.0)"),
CL(1910, "2017 RTW (15.0)"),
CL(1911, "2017 (15.3)"),
CL(1912, "2017 (15.5)"),
CL(1913, "2017 (15.6)"),
CL(1914, "2017 (15.7)"),
CL(1915, "2017 (15.8)"),
CL(1916, "2017 (15.9)"),
CL(1920, "2019 RTW (16.0)"),
CL(1921, "2019 (16.1)"),
CL(1922, "2019 (16.2)"),
CL(1923, "2019 (16.3)"),
CL(1924, "2019 (16.4)"),
CL(1925, "2019 (16.5)"),
CL(1926, "2019 (16.6)"),
CL(1927, "2019 (16.7)"),
CL(1928, "2019 (16.8, 16.9)"),
CL(1929, "2019 (16.10, 16.11)"),
CL(1930, "2022 RTW (17.0)"),
CL(1931, "2022 (17.1)"),
CL(1932, "2022 (17.2)"),
CL(1933, "2022 (17.3)"),
CL(1934, "2022 (17.4)"),
CL(1935, "2022 (17.5)"),
CL(1936, "2022 (17.6)"),
CL(1937, "2022 (17.7)"),
CL(1938, "2022 (17.8)"),
CL(1939, "2022 (17.9)"),
CL(1940, "2022 (17.10)")
};
#undef CL
const char* info = "VS version unknown - ";
for ( int i = 0; i < ARRAY_LEN(clVersions); ++i ) {
if ( clVersions[i].mscVer == _MSC_VER ) {
info = va("VS %s (%s) - ", clVersions[i].year, clVersions[i].number);
info = va("VS %s - ", clVersions[i].title);
break;
}
}