diff options
author | wm4 <wm4@nowhere> | 2018-01-17 12:10:41 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-01-18 00:25:00 -0800 |
commit | da662ef182a5f62ec0c75aa43cbd94d5647add2a (patch) | |
tree | e6b81509cdbdb2a1363637d6bc36501338a11df1 /stream | |
parent | 4f49334318179201e56b62e065d39b7e38485fab (diff) |
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 'stream')
-rw-r--r-- | stream/tvi_v4l2.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |