summaryrefslogtreecommitdiffstats
path: root/src/diag.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-05-18 12:16:30 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-05-18 16:30:25 -0400
commitded8567215afa498295660d123159f26210e066a (patch)
treee73f5602063ffc2a69658392c9497b61d73d6dd3 /src/diag.c
parent873e6bf836b2dd2d7dedc905c0386b7cd66c0d85 (diff)
downloadbfs-ded8567215afa498295660d123159f26210e066a.tar.xz
diag: New bfs_abort() and bfs_bug() macros
Diffstat (limited to 'src/diag.c')
-rw-r--r--src/diag.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/diag.c b/src/diag.c
index 53db98e..d7ffaa6 100644
--- a/src/diag.c
+++ b/src/diag.c
@@ -9,7 +9,15 @@
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
-#include <stddef.h>
+#include <stdlib.h>
+
+noreturn void bfs_abortf(const char *format, ...) {
+ va_list args;
+ va_start(args, format);
+ vfprintf(stderr, format, args);
+ va_end(args);
+ abort();
+}
void bfs_perror(const struct bfs_ctx *ctx, const char *str) {
bfs_error(ctx, "%s: %m.\n", str);