mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02:00
For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives
This commit is contained in:
@@ -133,11 +133,11 @@ Nullstream dummyout;
|
||||
Assert
|
||||
*/
|
||||
|
||||
void assert_fail(const char *assertion, const char *file,
|
||||
void sanity_check_fn(const char *assertion, const char *file,
|
||||
unsigned int line, const char *function)
|
||||
{
|
||||
DEBUGPRINT("\nIn thread %lx:\n"
|
||||
"%s:%u: %s: Assertion '%s' failed.\n",
|
||||
"%s:%u: %s: An engine assumption '%s' failed.\n",
|
||||
(unsigned long)get_current_thread_id(),
|
||||
file, line, function, assertion);
|
||||
|
||||
@@ -149,6 +149,22 @@ void assert_fail(const char *assertion, const char *file,
|
||||
abort();
|
||||
}
|
||||
|
||||
void fatal_error_fn(const char *msg, const char *file,
|
||||
unsigned int line, const char *function)
|
||||
{
|
||||
DEBUGPRINT("\nIn thread %lx:\n"
|
||||
"%s:%u: %s: A fatal error occurred: %s\n",
|
||||
(unsigned long)get_current_thread_id(),
|
||||
file, line, function, msg);
|
||||
|
||||
debug_stacks_print();
|
||||
|
||||
if(g_debugstreams[1])
|
||||
fclose(g_debugstreams[1]);
|
||||
|
||||
abort();
|
||||
}
|
||||
|
||||
/*
|
||||
DebugStack
|
||||
*/
|
||||
|
Reference in New Issue
Block a user