[php-src] master: Windows: bump to C17 and enable C11 atomics on MSVC (#23982)
| From: | Marc via GitHub | Date: | Tue, 29 Sep 2026 09:46:04 +0000 |
| Subject: | [php-src] master: Windows: bump to C17 and enable C11 atomics on MSVC (#23982) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141666@lists.php.net to get a copy of this message | ||
Author: Marc (henderkes)
Committer: GitHub (web-flow)
Pusher: shivammathur
Date: 2026-09-29T15:16:01+05:30
Commit: https://github.com/php/php-src/commit/eb222030627913408258f00dcec6fa63382dd634
Raw diff: https://github.com/php/php-src/commit/eb222030627913408258f00dcec6fa63382dd634.diff
Windows: bump to C17 and enable C11 atomics on MSVC (#23982)
Changed paths:
M UPGRADING.INTERNALS
M ext/intl/config.w32
M win32/build/confutils.js
Diff:
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index bce419d784e4..e542dcfec571 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -26,6 +26,11 @@ PHP 8.7 INTERNALS UPGRADE NOTES
2. Build system changes
========================
+- Windows build system changes:
+ . C sources are now compiled as C17. MSVC builds require Visual Studio
+ 2026 or later and enable /experimental:c11atomics.
+ . C++-only extension compiler flags can be added to CXXFLAGS_<EXTENSION>.
+
- Unix build system changes:
. Autoconf minimum required version upgraded to 2.71.
diff --git a/ext/intl/config.w32 b/ext/intl/config.w32
index 7369619404b9..984ba94907ab 100644
--- a/ext/intl/config.w32
+++ b/ext/intl/config.w32
@@ -125,8 +125,8 @@ if (PHP_INTL != "no") {
/* Compat for ICU before 58.1.*/
CHECK_LIB("icule.lib", "intl", PHP_INTL);
CHECK_LIB("iculx.lib", "intl", PHP_INTL);
- ADD_FLAG("CXXFLAGS_INTL", "/std:c++17");
- ADD_FLAG("CFLAGS_INTL", "/EHsc /DUNISTR_FROM_CHAR_EXPLICIT=explicit
/DUNISTR_FROM_STRING_EXPLICIT=explicit /DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
/DU_HIDE_OBSOLETE_UTF_OLD_H=1");
+ ADD_FLAG("CXXFLAGS_INTL", "/std:c++17 /EHsc");
+ ADD_FLAG("CFLAGS_INTL", "/DUNISTR_FROM_CHAR_EXPLICIT=explicit
/DUNISTR_FROM_STRING_EXPLICIT=explicit /DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
/DU_HIDE_OBSOLETE_UTF_OLD_H=1");
} else {
WARNING("intl not enabled; libraries and/or headers not found");
}
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 6b6fbe96b52e..1e6604875ff1 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1625,7 +1625,10 @@ function ADD_SOURCES(dir, file_list, target, obj_dir, duplicate_sources)
sym = target.toUpperCase() + "_GLOBAL_OBJS";
flags = "CFLAGS_" + target.toUpperCase() + '_OBJ';
- var c_flags = VS_TOOLSET ? " /std:c11" : "";
+ var c_flags = ICC_TOOLSET ? " /Qstd=c17" : " /std:c17";
+ if (VS_TOOLSET) {
+ c_flags += " /experimental:c11atomics";
+ }
var cxx_flags = " $(CXXFLAGS_" + target.toUpperCase() + ")";
var bd = get_define('BUILD_DIR');
@@ -1792,7 +1795,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir, duplicate_sources)
"--library=win32\\build\\cppcheck.cfg " +
"--library=" + cppcheck_lib + " " +
/* "--rule-file=win32\build\cppcheck_rules.xml " + */
- " --std=c11 --std=c++11 " +
+ " --std=c17 --std=c++11 " +
"--quiet --inconclusive --template=vs -j 4 " +
"--suppress=unmatchedSuppression " +
"--suppressions-list=win32\\build\\cppcheck_suppress.txt ";
@@ -3154,7 +3157,7 @@ function toolset_get_compiler_version()
if (VS_TOOLSET) {
version = probe_binary(PHP_CL).substr(0, 5).replace('.', '');
- if (version < 1920) {
+ if (version < 1950) {
ERROR("Building with MSC_VER " + version + " is no longer supported");
}
return version;