Add a generic macro to align a value to the next alignment boundary.
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4386
38d2e660-2303-0410-9eaa-
f027e97ec537
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif /* !(COMPILER_STATEMENT_EXPRESSIONS && COMPILER_TYPEOF) */
+/** Align \p value to the next \p align boundary */
+#define ALIGN_UP(value, align) (((value) & ((align) - 1)) ? \
+ (((value) + ((align) - 1)) & ~((align) - 1)) : \
+ (value))
+
/** Bound \a x between \a min and \a max. */
#define MINMAX(min,x,max) (MIN(MAX(min, x), max))