summaryrefslogtreecommitdiffstats
path: root/macro.h
diff options
context:
space:
mode:
Diffstat (limited to 'macro.h')
-rw-r--r--macro.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/macro.h b/macro.h
index 368555d..847bf97 100644
--- a/macro.h
+++ b/macro.h
@@ -39,4 +39,10 @@
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
+static inline size_t align(size_t l) {
+ return (((l + sizeof(void*) - 1) / sizeof(void*)) * sizeof(void*));
+}
+
+#define ALIGN(x) (align(x))
+
#endif