luna: Make check() and expect() output errors in userspace

This commit is contained in:
apio 2023-01-10 19:02:16 +01:00
parent c82ed5df01
commit 3ac3d54788
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -1,6 +1,11 @@
#include <luna/Attributes.h> #include <luna/Attributes.h>
_weak [[noreturn]] bool __check_failed(const char*, const char*, const char*, const char*) #include <stdio.h>
#include <stdlib.h>
_weak [[noreturn]] bool __check_failed(const char* file, const char* line, const char* func, const char* expr)
{ {
__builtin_trap(); // FIXME: Output to standard error instead of standard output.
printf("Check failed at %s:%s in %s: %s\n", file, line, func, expr);
abort();
} }