summary refs log tree commit diff stats
path: root/rust/qmk-hid-com/src_c/src/error.c
blob: f970cfc07558ccca255d61cf6b0c5f1a43482165 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <wayland-client.h>

#include "error.h"

__attribute__((noreturn)) __attribute__((format(printf, 1, 2))) void
fail(const char *format, ...) {
  va_list vas;

  va_start(vas, format);
  fprintf(stderr, "Error: ");
  vfprintf(stderr, format, vas);
  va_end(vas);

  fprintf(stderr, "\n");

  exit(EXIT_FAILURE);
}