diff options
author | wm4 <wm4@nowhere> | 2019-06-07 13:33:47 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:05 +0200 |
commit | 46247df6e55bf9a93588c5adfdc553c1d189b2fc (patch) | |
tree | 0f4e7aa80fcc5b27fa07971196bc6f1300ccd681 | |
parent | 7c356ee83690138060a20b733c7ab1bbc9cef037 (diff) | |
download | mpv-46247df6e55bf9a93588c5adfdc553c1d189b2fc.tar.bz2 mpv-46247df6e55bf9a93588c5adfdc553c1d189b2fc.tar.xz |
common: add MP_IS_ALIGNED macro
-rw-r--r-- | common/common.h | 1 |
1 files changed, 1 insertions, 0 deletions
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)) |