2018-10-31 21:31:56 +01:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2019-01-16 12:57:07 +01:00
|
|
|
#include <unistd.h>
|
2018-10-28 09:36:21 +01:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
2019-04-23 21:52:02 +02:00
|
|
|
#ifdef DEBUG
|
2018-11-04 13:13:57 +01:00
|
|
|
void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func)
|
2018-10-28 09:36:21 +01:00
|
|
|
{
|
2019-01-16 12:57:07 +01:00
|
|
|
dbgprintf("USERSPACE(%d) ASSERTION FAILED: %s\n%s:%u in %s\n", getpid(), msg, file, line, func);
|
2018-10-31 21:31:56 +01:00
|
|
|
fprintf(stderr, "ASSERTION FAILED: %s\n%s:%u in %s\n", msg, file, line, func);
|
2018-10-28 09:36:21 +01:00
|
|
|
abort();
|
2018-11-04 14:09:30 +01:00
|
|
|
for (;;);
|
2018-10-28 09:36:21 +01:00
|
|
|
}
|
2019-04-23 21:52:02 +02:00
|
|
|
#endif
|
2018-10-28 09:36:21 +01:00
|
|
|
|
|
|
|
}
|