mdbx-windows: always call debugger if it present when assertion check failed.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2022-09-22 17:26:59 +03:00
parent beda291692
commit f51ace3db8

View File

@ -242,14 +242,14 @@ __cold void mdbx_assert_fail(const MDBX_env *env, const char *msg,
if (num < 1 || !message) if (num < 1 || !message)
message = "<troubles with assertion-message preparation>"; message = "<troubles with assertion-message preparation>";
OutputDebugStringA(message); OutputDebugStringA(message);
if (IsDebuggerPresent())
DebugBreak();
#else #else
__assert_fail(msg, "mdbx", line, func); __assert_fail(msg, "mdbx", line, func);
#endif #endif
} }
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
if (IsDebuggerPresent())
DebugBreak();
FatalExit(ERROR_UNHANDLED_ERROR); FatalExit(ERROR_UNHANDLED_ERROR);
#else #else
abort(); abort();