mdbx: add mdbx_panic() to C API.

Change-Id: I009a7889311b57ae2210822a8087889f900919f8
This commit is contained in:
Leonid Yuriev
2020-09-10 15:37:59 +03:00
parent 58bcfb006e
commit cd4caeb03d
3 changed files with 7 additions and 11 deletions

View File

@@ -238,8 +238,6 @@ void __cold mdbx_assert_fail(const MDBX_env *env, const char *msg,
#endif /* __ANDROID_API__ || MDBX_DEBUG */
#if !defined(__ANDROID_API__)
__cold void mdbx_panic(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
@@ -257,14 +255,16 @@ __cold void mdbx_panic(const char *fmt, ...) {
if (IsDebuggerPresent())
DebugBreak();
FatalExit(ERROR_UNHANDLED_ERROR);
#else
#if defined(__ANDROID_API__)
__android_log_assert("panic", "mdbx", "%s", const_message);
#else
__assert_fail(const_message, "mdbx", 0, "panic");
#endif /* __ANDROID_API__ */
abort();
#endif
}
#endif /* ! __ANDROID_API__ */
/*----------------------------------------------------------------------------*/
#ifndef mdbx_vasprintf