summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/stdlib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/stdlib.h b/src/include/stdlib.h
index 83eb966b25..cb5a6ca703 100644
--- a/src/include/stdlib.h
+++ b/src/include/stdlib.h
@@ -7,6 +7,8 @@
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1UL)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+#define ALIGN_UP(x,a) ALIGN((x),(a))
+#define ALIGN_DOWN(x,a) ((x) & ~((typeof(x))(a)-1UL))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))