summaryrefslogtreecommitdiffstats
path: root/mpvcore/mp_common.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-26 15:05:59 +0200
committerwm4 <wm4@nowhere>2013-10-26 15:05:59 +0200
commit7abc1bef40869d4efba88df8c5ad8b1ea4c49c57 (patch)
treeed1ef6c259c01dc119c4b99f84daefef5161bd93 /mpvcore/mp_common.h
parent74e7043cc756e171ea1a7fd4be01019c14e1e265 (diff)
downloadmpv-7abc1bef40869d4efba88df8c5ad8b1ea4c49c57.tar.bz2
mpv-7abc1bef40869d4efba88df8c5ad8b1ea4c49c57.tar.xz
af: replace macros with too generic names
Defining names like min, max etc. in an often used header is not really a good idea. Somewhat similar to MPlayer svn commit 36491, but don't use libavutil, because that typically causes us sorrow.
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]))