summaryrefslogtreecommitdiffstats
path: root/mpvcore/mp_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'mpvcore/mp_common.h')
-rw-r--r--mpvcore/mp_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/mpvcore/mp_common.h b/mpvcore/mp_common.h
index 543c22073e..ecd84e33b6 100644
--- a/mpvcore/mp_common.h
+++ b/mpvcore/mp_common.h
@@ -36,6 +36,7 @@
#define MPMAX(a, b) ((a) > (b) ? (a) : (b))
#define MPMIN(a, b) ((a) > (b) ? (b) : (a))
+#define MPCLAMP(a, min, max) (((a) < (min)) ? (min) : (((a) > (max)) ? (max) : (a)))
#define MPSWAP(type, a, b) \
do { type SWAP_tmp = b; b = a; a = SWAP_tmp; } while (0)
#define MP_ARRAY_SIZE(s) (sizeof(s) / sizeof((s)[0]))