summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_alsa.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-17 12:10:41 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-18 00:25:00 -0800
commitda662ef182a5f62ec0c75aa43cbd94d5647add2a (patch)
treee6b81509cdbdb2a1363637d6bc36501338a11df1 /audio/out/ao_alsa.c
parent4f49334318179201e56b62e065d39b7e38485fab (diff)
downloadmpv-da662ef182a5f62ec0c75aa43cbd94d5647add2a.tar.bz2
mpv-da662ef182a5f62ec0c75aa43cbd94d5647add2a.tar.xz
Fix undefined preprocessor behavior
This commit eliminates the following clang warning: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] Going by the clang commit message, this seems to be explicitly specified as UB by the standard, and they added this warning because MSVC apparently results in different behavior. Whatever, we can just avoid the warning with some small changes.
Diffstat (limited to 'audio/out/ao_alsa.c')
-rw-r--r--audio/out/ao_alsa.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index 39c3f03118..b86bf5d89e 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -42,8 +42,11 @@
#include <alsa/asoundlib.h>
-#define HAVE_CHMAP_API \
- (defined(SND_CHMAP_API_VERSION) && SND_CHMAP_API_VERSION >= (1 << 16))
+#if defined(SND_CHMAP_API_VERSION) && SND_CHMAP_API_VERSION >= (1 << 16)
+#define HAVE_CHMAP_API 1
+#else
+#define HAVE_CHMAP_API 0
+#endif
#include "ao.h"
#include "internal.h"