summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2019-03-31 17:28:50 +0200
committerAnatol Belski <ab@php.net>2019-03-31 17:33:36 +0200
commitdd0aca0c11f2572e37fd9583866f37d895a80e4e (patch)
tree839a1a0bd59259160598bf699fbec682a766090c /main
parente4a664ecf84fb74ecb8046deb77a1218f2f6cb62 (diff)
downloadphp-git-dd0aca0c11f2572e37fd9583866f37d895a80e4e.tar.gz
Implement stricter CRT check
This aligns with the recommendations about VS2015, VS2017 and VS2019 compatibility. More info below https://devblogs.microsoft.com/cppblog/cpp-binary-compatibility-and-pain-free-upgrades-to-visual-studio-2019/
Diffstat (limited to 'main')
-rw-r--r--main/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/main.c b/main/main.c
index 6286990f62..de0d042843 100644
--- a/main/main.c
+++ b/main/main.c
@@ -2187,6 +2187,16 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
#endif
#ifdef PHP_WIN32
+# if PHP_LINKER_MAJOR == 14
+ /* Extend for other CRT if needed. */
+ char *img_err;
+ if (!php_win32_crt_compatible("vcruntime140.dll", &img_err)) {
+ php_error(E_CORE_WARNING, img_err);
+ efree(img_err);
+ return FAILURE;
+ }
+# endif
+
/* start up winsock services */
if (WSAStartup(wVersionRequested, &wsaData) != 0) {
php_printf("\nwinsock.dll unusable. %d\n", WSAGetLastError());