mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-23 21:14:28 +08:00
mdbx: добавлено MDBX_NORETURN
к mdbx_panic()
и mdbx_assert_fail()
.
This commit is contained in:
26
src/osal.c
26
src/osal.c
@@ -247,13 +247,15 @@ __cold void mdbx_assert_fail(const MDBX_env *env, const char *msg,
|
||||
#endif
|
||||
}
|
||||
|
||||
while (1) {
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
if (IsDebuggerPresent())
|
||||
DebugBreak();
|
||||
FatalExit(ERROR_UNHANDLED_ERROR);
|
||||
if (IsDebuggerPresent())
|
||||
DebugBreak();
|
||||
FatalExit(ERROR_UNHANDLED_ERROR);
|
||||
#else
|
||||
abort();
|
||||
abort();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
__cold void mdbx_panic(const char *fmt, ...) {
|
||||
@@ -267,16 +269,18 @@ __cold void mdbx_panic(const char *fmt, ...) {
|
||||
(num < 1 || !message) ? "<troubles with panic-message preparation>"
|
||||
: message;
|
||||
|
||||
while (1) {
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
OutputDebugStringA("\r\nMDBX-PANIC: ");
|
||||
OutputDebugStringA(const_message);
|
||||
if (IsDebuggerPresent())
|
||||
DebugBreak();
|
||||
FatalExit(ERROR_UNHANDLED_ERROR);
|
||||
OutputDebugStringA("\r\nMDBX-PANIC: ");
|
||||
OutputDebugStringA(const_message);
|
||||
if (IsDebuggerPresent())
|
||||
DebugBreak();
|
||||
FatalExit(ERROR_UNHANDLED_ERROR);
|
||||
#else
|
||||
__assert_fail(const_message, "mdbx", 0, "panic");
|
||||
abort();
|
||||
__assert_fail(const_message, "mdbx", 0, "panic");
|
||||
abort();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
Reference in New Issue
Block a user