Fix potentially erroneous php_win32_crt_compatible() (GH-16374)

Whether we link with a debug runtime or a normal runtime is not really
related to `PHP_DEBUG`, but rather to `_DEBUG`[1].

We also stop defining that flag, since the compiler already does that.

[1] <https://learn.microsoft.com/en-us/cpp/c-runtime-library/debug>
This commit is contained in:
Christoph M. Becker 2024-10-12 16:00:15 +02:00 committed by GitHub
parent 2e263d26a2
commit 9402121a46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -3432,7 +3432,7 @@ function toolset_setup_common_libs()
function toolset_setup_build_mode()
{
if (PHP_DEBUG == "yes") {
ADD_FLAG("CFLAGS", "/LDd /MDd /Od /D _DEBUG /D ZEND_DEBUG=1 " +
ADD_FLAG("CFLAGS", "/LDd /MDd /Od /D ZEND_DEBUG=1 " +
(TARGET_ARCH == 'x86'?"/ZI":"/Zi"));
ADD_FLAG("LDFLAGS", "/debug");
// Avoid problems when linking to release libraries that use the release

View File

@ -486,7 +486,7 @@ PHP_WINUTIL_API BOOL php_win32_crt_compatible(char **err)
{/*{{{*/
#if PHP_LINKER_MAJOR == 14
/* Extend for other CRT if needed. */
# if PHP_DEBUG
# ifdef _DEBUG
const char *crt_name = "vcruntime140d.dll";
# else
const char *crt_name = "vcruntime140.dll";