2021-07-17 05:59:32 +03:00
|
|
|
#include "refc_util.h"
|
|
|
|
|
2022-09-21 13:13:15 +03:00
|
|
|
#include <stdarg.h>
|
2021-07-17 05:59:32 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2022-09-21 13:13:15 +03:00
|
|
|
void idris2_refc_verify_failed(const char *file, int line, const char *cond,
|
|
|
|
const char *fmt, ...) {
|
|
|
|
va_list ap;
|
|
|
|
va_start(ap, fmt);
|
2021-07-17 05:59:32 +03:00
|
|
|
|
2022-09-21 13:13:15 +03:00
|
|
|
char message[1000];
|
|
|
|
snprintf(message, sizeof(message), fmt, ap);
|
2021-07-17 05:59:32 +03:00
|
|
|
|
2022-09-21 13:13:15 +03:00
|
|
|
fprintf(stderr, "assertion failed in %s:%d: %s: %s\n", file, line, cond,
|
|
|
|
message);
|
|
|
|
abort();
|
2021-07-17 05:59:32 +03:00
|
|
|
}
|