diff --git a/src/Package/Extension/intl.php b/src/Package/Extension/intl.php index f5e17c1f..dd7d3ffd 100644 --- a/src/Package/Extension/intl.php +++ b/src/Package/Extension/intl.php @@ -16,7 +16,7 @@ use StaticPHP\Util\FileSystem; class intl extends PhpExtensionPackage { #[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-intl')] - #[PatchDescription('Fix intl config.w32: replace hardcoded true with PHP_INTL_SHARED for static build support')] + #[PatchDescription('Fix intl config.w32: replace hardcoded true with PHP_INTL_SHARED for static build support; add /std:c++17 required by ICU 73+')] public function patchBeforeBuildconfForWindows(PackageInstaller $installer): void { $php_src = $installer->getTargetPackage('php')->getSourceDir(); @@ -25,5 +25,11 @@ class intl extends PhpExtensionPackage 'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,', 'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", PHP_INTL_SHARED,' ); + // ICU 73+ headers (char16ptr.h etc.) unconditionally include which requires C++17. + FileSystem::replaceFileStr( + "{$php_src}/ext/intl/config.w32", + 'ADD_FLAG("CFLAGS_INTL", "/EHsc', + 'ADD_FLAG("CFLAGS_INTL", "/std:c++17 /EHsc' + ); } }