mdbx-windows: rework mdbx_assert_fail() and mdbx_panic() to avoid dependency from CRT.

7 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: I40dc8d6a7d1d955c13c7d328ee904f0e6f30b248
This commit is contained in:
Leonid Yuriev
2018-10-14 01:11:14 +03:00
parent ae2875e248
commit ded5269937
4 changed files with 42 additions and 32 deletions

View File

@@ -40,9 +40,6 @@
/*----------------------------------------------------------------------------*/
/* Internal inlines */
#undef assert
#define assert(expr) mdbx_assert(NULL, expr)
static __inline bool mdbx_is_power2(size_t x) { return (x & (x - 1)) == 0; }
static __inline size_t mdbx_roundup2(size_t value, size_t granularity) {
@@ -1409,10 +1406,8 @@ void __cold mdbx_debug_log(int type, const char *function, int line,
OutputDebugStringA(msg);
mdbx_free(msg);
}
va_end(args);
return;
}
#endif
#else
if (function && line > 0)
fprintf(stderr, "%s:%d ", function, line);
else if (function)
@@ -1421,6 +1416,7 @@ void __cold mdbx_debug_log(int type, const char *function, int line,
fprintf(stderr, "%d: ", line);
vfprintf(stderr, fmt, args);
fflush(stderr);
#endif
}
va_end(args);
}