mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-27 06:35:37 +00:00
Suppress error dialogs on assertion failures in MinGW.
This commit is contained in:
parent
c3a6e01f52
commit
4ecfdd50b6
@ -28,11 +28,17 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
# include <windows.h>
|
||||||
# include <crtdbg.h>
|
# include <crtdbg.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
// Don't display any error dialogs. This also suppresses message boxes
|
||||||
|
// on assertion failures in MinGW where _set_error_mode/CrtSetReportMode
|
||||||
|
// doesn't help.
|
||||||
|
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX |
|
||||||
|
SEM_NOOPENFILEERRORBOX);
|
||||||
// Disable message boxes on assertion failures.
|
// Disable message boxes on assertion failures.
|
||||||
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
|
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
|
||||||
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
|
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user