-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconditions.h
20 lines (16 loc) · 1.02 KB
/
conditions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// SPDX-License-Identifier: MIT
#ifndef CONDITIONS_H
#define CONDITIONS_H
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ENSURES(c, s) \
do { \
const int condition = c; \
if (!condition) { \
printf("loader [%s:%d (%s)] %s - errno: %s\n", __FILE__, __LINE__, __func__, s, strerror(errno)); \
exit(EXIT_FAILURE); \
} \
} while (0)
#endif // CONDITIONS_H