From 78b10b507a84e4e5400a5e2861ca3fdf0fa73b62 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 4 Jul 2024 12:12:50 +0200 Subject: [PATCH] Update MSVC compiler version detection As of Visual Studio 2015, the major version of the compiler (`cl.exe`) is 19, and the minor version increases by steps of 10. However, the latest Visual Studio 2022 release has the version `19.40`, so that Visual Studio version is not properly detected. This is not a big deal regarding the reported compiler version (`php -v` etc.), but the filenames of the builds would no longer match the expectations (instead of `vs17` there is now `19.40.33811` or another build number). This implies that the files would have to be renamed manually to be properly handled by windows.php.net (or that code would have to be adapted). Therefore we update the version detection to detect all versions < 1950 as Visual Studio 2022, assuming that "For major releases, the minor version increases by 10."[1] still holds in the future. [1] --- win32/build/confutils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 1a84142a18783..20b7f4e2245c8 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3104,7 +3104,7 @@ function toolset_get_compiler_name(short) version = probe_binary(PHP_CL).substr(0, 5).replace('.', ''); - if (version >= 1940) { + if (version >= 1950) { return name; } else if (version >= 1930) { name = short ? "VS17" : "Visual C++ 2022";