Skip to content

Commit f2db5fd

Browse files
committed
FFmpegUtilities: Rename RSHIFT to FF_RSHIFT
FFmpeg and Ruby have competing definitions of the RSHIFT macro, so building the Ruby bindings causes warnings to be thrown when it's redefined. This change defines FF_RSHIFT to replace FFmpeg's RSHIFT, which is undef'd
1 parent 0587ada commit f2db5fd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/FFmpegUtilities.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@
114114
#define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
115115
#endif
116116

117+
// FFmpeg's libavutil/common.h defines an RSHIFT incompatible with Ruby's
118+
// definition in ruby/config.h, so we move it to FF_RSHIFT
119+
#ifdef RSHIFT
120+
#define FF_RSHIFT(a, b) RSHIFT(a, b)
121+
#undef RSHIFT
122+
#endif
123+
117124
#ifdef USE_SW
118125
#define SWR_CONVERT(ctx, out, linesize, out_count, in, linesize2, in_count) \
119126
swr_convert(ctx, out, out_count, (const uint8_t **)in, in_count)

0 commit comments

Comments
 (0)