mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
add win32 configure option for CLI to switch on CRT heap debugging
This commit is contained in:
parent
85735c23c6
commit
d756e1db23
@ -2,8 +2,12 @@
|
||||
// $Id$
|
||||
|
||||
ARG_ENABLE('cli', 'Build CLI version of PHP', 'yes');
|
||||
ARG_ENABLE('crt-debug', 'Extra CRT debugging', 'no');
|
||||
|
||||
if (PHP_CLI == "yes") {
|
||||
SAPI('cli', 'getopt.c php_cli.c', 'php.exe');
|
||||
if (PHP_CRT_DEBUG == "yes") {
|
||||
ADD_FLAG("CFLAGS_CLI", "/D PHP_WIN32_DEBUG_HEAP");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -537,6 +537,20 @@ int main(int argc, char *argv[])
|
||||
void ***tsrm_ls;
|
||||
#endif
|
||||
|
||||
#if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP)
|
||||
{
|
||||
int tmp_flag;
|
||||
|
||||
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
|
||||
|
||||
tmp_flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
|
||||
tmp_flag |= _CRTDBG_DELAY_FREE_MEM_DF;
|
||||
tmp_flag |= _CRTDBG_LEAK_CHECK_DF;
|
||||
|
||||
_CrtSetDbgFlag(tmp_flag);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
#if defined(SIGPIPE) && defined(SIG_IGN)
|
||||
|
Loading…
Reference in New Issue
Block a user