From dd0aca0c11f2572e37fd9583866f37d895a80e4e Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 31 Mar 2019 17:28:50 +0200 Subject: 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/ --- main/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main') 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()); -- cgit v1.2.1