diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-05-18 12:16:30 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-05-18 16:30:25 -0400 |
commit | ded8567215afa498295660d123159f26210e066a (patch) | |
tree | e73f5602063ffc2a69658392c9497b61d73d6dd3 /src/diag.c | |
parent | 873e6bf836b2dd2d7dedc905c0386b7cd66c0d85 (diff) | |
download | bfs-ded8567215afa498295660d123159f26210e066a.tar.xz |
diag: New bfs_abort() and bfs_bug() macros
Diffstat (limited to 'src/diag.c')
-rw-r--r-- | src/diag.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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); |