-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.h
19 lines (16 loc) · 800 Bytes
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Copyright 2021 <Madalina-Valentina Zanficu 313CA> */
#ifndef UTILS_H_
#define UTILS_H_
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
/* useful macro for handling error codes */
#define DIE(assertion, call_description) \
do { \
if (assertion) { \
fprintf(stderr, "(%s, %d): ", __FILE__, __LINE__); \
perror(call_description); \
exit(errno); \
} \
} while (0)
#endif /* UTILS_H_ */