Skip to content

Commit 9402121

Browse files
authored
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>
1 parent 2e263d2 commit 9402121

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

win32/build/confutils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3432,7 +3432,7 @@ function toolset_setup_common_libs()
34323432
function toolset_setup_build_mode()
34333433
{
34343434
if (PHP_DEBUG == "yes") {
3435-
ADD_FLAG("CFLAGS", "/LDd /MDd /Od /D _DEBUG /D ZEND_DEBUG=1 " +
3435+
ADD_FLAG("CFLAGS", "/LDd /MDd /Od /D ZEND_DEBUG=1 " +
34363436
(TARGET_ARCH == 'x86'?"/ZI":"/Zi"));
34373437
ADD_FLAG("LDFLAGS", "/debug");
34383438
// Avoid problems when linking to release libraries that use the release

win32/winutil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ PHP_WINUTIL_API BOOL php_win32_crt_compatible(char **err)
486486
{/*{{{*/
487487
#if PHP_LINKER_MAJOR == 14
488488
/* Extend for other CRT if needed. */
489-
# if PHP_DEBUG
489+
# ifdef _DEBUG
490490
const char *crt_name = "vcruntime140d.dll";
491491
# else
492492
const char *crt_name = "vcruntime140.dll";

0 commit comments

Comments
 (0)