summaryrefslogtreecommitdiff
path: root/libswscale/utils.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2017-08-24 21:00:01 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2017-08-25 13:44:57 +0100
commitadd7b3bc3fb7685cd0a3ccffd2b09cc0e32c39ec (patch)
tree286730962b85046b0675fcfe0b53afc14c825b2b /libswscale/utils.c
parent9e02f35f6a1b27090fa2679e9a3897ecdf144b2a (diff)
downloadffmpeg-add7b3bc3fb7685cd0a3ccffd2b09cc0e32c39ec.tar.gz
utils: Do not expand a macro with 'defined' in it
Fixes: libswscale/utils.c:1632:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] #if USE_MMAP ^ libswscale/utils.c:1577:49: note: expanded from macro 'USE_MMAP' #define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS) ^ Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r--libswscale/utils.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index b75510d206..dcab707de6 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1574,7 +1574,11 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
}
}
-#define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS)
+#if HAVE_MMAP && HAVE_MPROTECT && defined(MAP_ANONYMOUS)
+#define USE_MMAP 1
+#else
+#define USE_MMAP 0
+#endif
/* precalculate horizontal scaler filter coefficients */
{