Skip to content

Commit

Permalink
Disable the debug popup on MSVC/win32
Browse files Browse the repository at this point in the history
For not popup dialog when crash happend on MSVC/win32
related issue: jerryscript-project#4463

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
  • Loading branch information
lygstate committed Nov 14, 2024
1 parent 2f2b9f6 commit f218384
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion jerry-main/main-desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
#include <stdlib.h>
#include <string.h>

#if defined(_WIN32)
#include <windows.h>

#include <crtdbg.h>
#endif /* _WIN32 */

#include "jerryscript-port.h"
#include "jerryscript.h"

Expand Down Expand Up @@ -115,7 +121,22 @@ main (int argc, char **argv)

main_args_t arguments;
arguments.sources_p = sources_p;

#if defined(_WIN32)
if (!IsDebuggerPresent ())
{
/* Disable all of the possible ways Windows conspires to make automated
testing impossible. */
#if defined(_MSC_VER)
_set_error_mode (_OUT_TO_STDERR);
_CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile (_CRT_WARN, _CRTDBG_FILE_STDERR);
_CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile (_CRT_ERROR, _CRTDBG_FILE_STDERR);
_CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile (_CRT_ASSERT, _CRTDBG_FILE_STDERR);
#endif /* _MSC_VER */
}
#endif /* _WIN32 */
if (!main_parse_args (argc, argv, &arguments))
{
return arguments.parse_result;
Expand Down

0 comments on commit f218384

Please sign in to comment.