summaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-rw-r--r--common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common.h b/common.h
index 0c644bd..e502853 100644
--- a/common.h
+++ b/common.h
@@ -24,6 +24,13 @@
#define MIN(x, y) ((x) > (y) ? (y) : (x))
#define ARRAY_ELEMS(arr) (sizeof(arr) / sizeof(*arr))
+#define SWAP(x, y, type) \
+do { \
+ type tmp = x; \
+ x = y; \
+ y = tmp; \
+} while (0)
+
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>