aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
new file mode 100644
index 0000000..d4d451f
--- /dev/null
+++ b/src/utils.h
@@ -0,0 +1,21 @@
1#ifndef INCLUDED_UTILS_H
2#define INCLUDED_UTILS_H
3
4#include <assert.h>
5#include <stdlib.h>
6
7#define MALLOC malloc
8#define REALLOC realloc
9#define FREE free
10#define ASSERT assert
11
12#define PRINT_EXP(EXP, FMT) printf (#EXP" = "FMT"\n", EXP)
13
14#define SWAP(A, B) \
15 ({ \
16 typeof (A) tmp = (A); \
17 (A) = (B); \
18 (B) = tmp; \
19 })
20
21#endif