From 46247df6e55bf9a93588c5adfdc553c1d189b2fc Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 7 Jun 2019 13:33:47 +0200 Subject: common: add MP_IS_ALIGNED macro --- common/common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/common/common.h b/common/common.h index de4c751baf..f5392fc575 100644 --- a/common/common.h +++ b/common/common.h @@ -43,6 +43,7 @@ // align must be a power of two (align >= 1), x >= 0 #define MP_ALIGN_UP(x, align) (((x) + (align) - 1) & ~((align) - 1)) #define MP_ALIGN_DOWN(x, align) ((x) & ~((align) - 1)) +#define MP_IS_ALIGNED(x, align) (!((x) & ((align) - 1))) // Return "a", or if that is NOPTS, return "def". #define MP_PTS_OR_DEF(a, def) ((a) == MP_NOPTS_VALUE ? (def) : (a)) -- cgit v1.2.3