summaryrefslogtreecommitdiff
path: root/src/include/stdlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/stdlib.h')
-rw-r--r--src/include/stdlib.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/stdlib.h b/src/include/stdlib.h
index e2b37e6fe9..c3052bd209 100644
--- a/src/include/stdlib.h
+++ b/src/include/stdlib.h
@@ -5,6 +5,9 @@
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
+#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))