-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevutils.h
More file actions
20 lines (15 loc) · 684 Bytes
/
devutils.h
File metadata and controls
20 lines (15 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef DEVUTILS_H
#define DEVUTILS_H
#include <stdlib.h>
#include <stdio.h>
// Copied from https://github.com/tsoding/nob.h/blob/main/nob.h
#define UNUSED(value) (void)(value)
#define UNREACHABLE(message) do { fprintf(stderr, "%s:%d: UNREACHABLE: %s\n", __FILE__, __LINE__, message); abort(); } while(0)
#define UNIMPLEMENTED(message) do { fprintf(stderr, "%s:%d: UNIMPLEMENTED: %s\n", __FILE__, __LINE__, message); abort(); } while(0)
// Copied from https://github.com/tsoding/la/blob/master/lag.c
#if defined(__GNUC__) || defined(__clang__)
#define CHECK_PRINTF_FMT(a, b) __attribute__ ((format (printf, a, b)))
#else
#define CHECK_PRINTF_FMT(...)
#endif
#endif // DEVUTILS_H