[FFmpeg-cvslog] utils: Do not expand a macro with 'defined' in it
Derek Buitenhuis
git at videolan.org
Fri Aug 25 15:59:42 EEST 2017
ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Thu Aug 24 21:00:01 2017 +0100| [add7b3bc3fb7685cd0a3ccffd2b09cc0e32c39ec] | committer: Derek Buitenhuis
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 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=add7b3bc3fb7685cd0a3ccffd2b09cc0e32c39ec
---
libswscale/utils.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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 */
{
More information about the ffmpeg-cvslog
mailing list