Skip to content

Commit 39706fc

Browse files
committed
Add code to stop asserts from tossing up dialogs
Assert dialogs can be a problem when running as a service. This change instructs assert info to be sent to stdout instead of a dialog.
1 parent 25e52cb commit 39706fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

contrib/win32/win32compat/socket.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
#include <fcntl.h>
3636
#include <sys/types.h>
3737
#include <sys/stat.h>
38-
#include <crtdbg.h>
38+
#ifndef __MINGW32__
39+
#include <Crtdbg.h>
40+
#endif
3941

4042
#include "sfds.h"
4143

@@ -2920,13 +2922,16 @@ void WSHELPinitialize()
29202922

29212923
winsock_initialized = 1;
29222924

2925+
#ifndef __MINGW32__
29232926
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
29242927
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
29252928
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
29262929
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
29272930
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
29282931
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
29292932

2933+
#endif
2934+
29302935

29312936
DBG_MSG("<- WSHELPinitialize()...\n");
29322937
}

0 commit comments

Comments
 (0)