summaryrefslogtreecommitdiffstats
path: root/common/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/common.h')
-rw-r--r--common/common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/common.h b/common/common.h
index f5392fc575..16e1ec4cfd 100644
--- a/common/common.h
+++ b/common/common.h
@@ -44,6 +44,7 @@
#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)))
+#define MP_IS_POWER_OF_2(x) ((x) > 0 && !((x) & ((x) - 1)))
// Return "a", or if that is NOPTS, return "def".
#define MP_PTS_OR_DEF(a, def) ((a) == MP_NOPTS_VALUE ? (def) : (a))