From da662ef182a5f62ec0c75aa43cbd94d5647add2a Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 17 Jan 2018 12:10:41 +0100 Subject: 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. --- stream/tvi_v4l2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'stream/tvi_v4l2.c') diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c index bd7ecd1e27..57bf6b875f 100644 --- a/stream/tvi_v4l2.c +++ b/stream/tvi_v4l2.c @@ -72,7 +72,11 @@ known issues: #define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x2000 #endif -#define HAVE_CLOCK_GETTIME (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) +#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 +#define HAVE_CLOCK_GETTIME 1 +#else +#define HAVE_CLOCK_GETTIME 0 +#endif #define info tvi_info_v4l2 static tvi_handle_t *tvi_init_v4l2(struct mp_log *log, tv_param_t* tv_param); -- cgit v1.2.3