2022-12-04 12:42:43 +01:00
|
|
|
#include <luna/Attributes.h>
|
2023-01-22 11:43:48 +01:00
|
|
|
#include <luna/SourceLocation.h>
|
2022-11-19 17:20:10 +01:00
|
|
|
|
2023-01-10 19:02:16 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2023-01-22 11:43:48 +01:00
|
|
|
_weak [[noreturn]] bool __check_failed(SourceLocation location, const char* expr)
|
2022-11-19 17:20:10 +01:00
|
|
|
{
|
2023-01-10 19:02:16 +01:00
|
|
|
// FIXME: Output to standard error instead of standard output.
|
2023-01-22 11:43:48 +01:00
|
|
|
printf("Check failed at %s:%d in %s: %s\n", location.file(), location.line(), location.function(), expr);
|
2023-01-10 19:02:16 +01:00
|
|
|
abort();
|
2023-01-02 13:07:29 +01:00
|
|
|
}
|