Skip to content

Commit

Permalink
swscale: Do not expand a macro with 'defined' in it
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
  • Loading branch information
dwbuiten authored and lu-zero committed Aug 28, 2017
1 parent 29ba1e6 commit 5e3f6dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libswscale/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,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 */
{
Expand Down

0 comments on commit 5e3f6dc

Please sign in to comment.