[FFmpeg-devel] [PATCH] avcodec/dvdec: Don't use restrict directly to fix build on MSVC

Matthias Troffaes matthias.troffaes at gmail.com
Mon Nov 11 13:02:25 EET 2019


I can confirm this patch fixes the compile problem on MSVC. See:

https://ci.appveyor.com/project/mcmtroffaes/ffmpeg-msvc-build/build/job/get5kbjlyw6w1vi5
https://github.com/mcmtroffaes/ffmpeg-msvc-build/commit/d1cc29f4c56937ec75b297bc6feaf0fd8989a549

Kind regards,
Matthias

On Sun, Nov 10, 2019 at 1:47 AM Andreas Rheinhardt
<andreas.rheinhardt at gmail.com> wrote:
>
> 004ebd4b added a function with a parameter that was declared as restrict
> and not av_restrict. This is not supported by MSVC as several FATE-boxes
> that now fail to build show. So use av_restrict.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
> Here is one of many logs of a failing build with MSVC:
> http://fate.ffmpeg.org/log.cgi?slot=x86_64-msvc15-windows-native&log=compile&time=20191110013536
>
> I don't have an MSVC setup and can therefore only attest that this patch
> doesn't affect either GCC or Clang (as expected).
>
>  libavcodec/dvdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
> index cfa0fb9905..578d7f505f 100644
> --- a/libavcodec/dvdec.c
> +++ b/libavcodec/dvdec.c
> @@ -269,7 +269,7 @@ static inline void bit_copy(PutBitContext *pb, GetBitContext *gb)
>          put_bits(pb, bits_left, get_bits(gb, bits_left));
>  }
>
> -static av_always_inline void put_block_8x4(int16_t *block, uint8_t *restrict p, int stride)
> +static av_always_inline void put_block_8x4(int16_t *block, uint8_t *av_restrict p, int stride)
>  {
>      int i, j;
>      const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
> --
> 2.20.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list