summary refs log tree commit diff
path: root/src/utils.c
blob: ee37110d60b04c5ee6a28716ee66ccce2f6f24e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "utils.h"
#include "types.h"

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdnoreturn.h>

#include "main.h"


noreturn void die(i32 code, s8 *fmt, ...)
{
    va_list args;

    fprintf(stderr, "%s: ", program_name);

    va_start(args, fmt);
    vfprintf(stderr, fmt, args);
    va_end(args);

    exit(code);
}