diff mbox

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

Message ID 20191110014724.32538-1-andreas.rheinhardt@gmail.com
State Accepted
Commit b25b6432a7345791c488fadba3bd1ac75ebb2cbb
Headers show

Commit Message

Andreas Rheinhardt Nov. 10, 2019, 1:47 a.m. UTC
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@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(-)

Comments

Matthias Troffaes Nov. 11, 2019, 11:02 a.m. UTC | #1
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@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@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@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Michael Niedermayer Nov. 11, 2019, 1:50 p.m. UTC | #2
On Mon, Nov 11, 2019 at 11:02:25AM +0000, Matthias Troffaes wrote:
> 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

will apply

thx

[...]
diff mbox

Patch

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;