diff mbox series

[FFmpeg-devel] avcodec/videotoolbox: fix use of unknown builtin '__builtin_available'

Message ID 1638451242-24362-1-git-send-email-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel] avcodec/videotoolbox: fix use of unknown builtin '__builtin_available' | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Lance Wang Dec. 2, 2021, 1:20 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Old system is:
OSX version: 10.11.6
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/videotoolbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Hendrik Leppkes Dec. 2, 2021, 2:39 p.m. UTC | #1
On Thu, Dec 2, 2021 at 2:20 PM <lance.lmwang@gmail.com> wrote:
>
> From: Limin Wang <lance.lmwang@gmail.com>
>
> Old system is:
> OSX version: 10.11.6
> Apple LLVM version 8.0.0 (clang-800.0.42.1)
> Target: x86_64-apple-darwin15.6.0
>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavcodec/videotoolbox.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
> index 284da97..195706c 100644
> --- a/libavcodec/videotoolbox.c
> +++ b/libavcodec/videotoolbox.c
> @@ -895,7 +895,7 @@ static int videotoolbox_start(AVCodecContext *avctx)
>          break;
>      }
>
> -#if defined(MAC_OS_X_VERSION_10_9) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9)
> +#if defined(MAC_OS_X_VERSION_10_9) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) && AV_HAS_BUILTIN(__builtin_available)
>      if (avctx->codec_id == AV_CODEC_ID_PRORES) {
>          if (__builtin_available(macOS 10.9, *)) {
>              VTRegisterProfessionalVideoWorkflowVideoDecoders();
> @@ -903,7 +903,7 @@ static int videotoolbox_start(AVCodecContext *avctx)
>      }
>  #endif
>
> -#if defined(MAC_OS_VERSION_11_0) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0)
> +#if __clang_major__ >= 9 && defined(MAC_OS_VERSION_11_0) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0) && AV_HAS_BUILTIN(__builtin_available)
>      if (__builtin_available(macOS 11.0, *)) {
>          VTRegisterSupplementalVideoDecoderIfAvailable(videotoolbox->cm_codec_type);
>      }

Any reason these checks are different, one with a clang version check,
one without?

- Hendrik
Lance Wang Dec. 2, 2021, 2:49 p.m. UTC | #2
On Thu, Dec 02, 2021 at 03:39:44PM +0100, Hendrik Leppkes wrote:
> On Thu, Dec 2, 2021 at 2:20 PM <lance.lmwang@gmail.com> wrote:
> >
> > From: Limin Wang <lance.lmwang@gmail.com>
> >
> > Old system is:
> > OSX version: 10.11.6
> > Apple LLVM version 8.0.0 (clang-800.0.42.1)
> > Target: x86_64-apple-darwin15.6.0
> >
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> >  libavcodec/videotoolbox.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
> > index 284da97..195706c 100644
> > --- a/libavcodec/videotoolbox.c
> > +++ b/libavcodec/videotoolbox.c
> > @@ -895,7 +895,7 @@ static int videotoolbox_start(AVCodecContext *avctx)
> >          break;
> >      }
> >
> > -#if defined(MAC_OS_X_VERSION_10_9) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9)
> > +#if defined(MAC_OS_X_VERSION_10_9) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) && AV_HAS_BUILTIN(__builtin_available)
> >      if (avctx->codec_id == AV_CODEC_ID_PRORES) {
> >          if (__builtin_available(macOS 10.9, *)) {
> >              VTRegisterProfessionalVideoWorkflowVideoDecoders();
> > @@ -903,7 +903,7 @@ static int videotoolbox_start(AVCodecContext *avctx)
> >      }
> >  #endif
> >
> > -#if defined(MAC_OS_VERSION_11_0) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0)
> > +#if __clang_major__ >= 9 && defined(MAC_OS_VERSION_11_0) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0) && AV_HAS_BUILTIN(__builtin_available)
> >      if (__builtin_available(macOS 11.0, *)) {
> >          VTRegisterSupplementalVideoDecoderIfAvailable(videotoolbox->cm_codec_type);
> >      }
> 
> Any reason these checks are different, one with a clang version check,
> one without?

Sorry, I check __clang_major__ at first and haven't remove it after choose to check with AV_HAS_BUILTIN. Will remove "__clang_major__ >= 9"

> 
> - Hendrik
> _______________________________________________
> 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".
diff mbox series

Patch

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 284da97..195706c 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -895,7 +895,7 @@  static int videotoolbox_start(AVCodecContext *avctx)
         break;
     }
 
-#if defined(MAC_OS_X_VERSION_10_9) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9)
+#if defined(MAC_OS_X_VERSION_10_9) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) && AV_HAS_BUILTIN(__builtin_available)
     if (avctx->codec_id == AV_CODEC_ID_PRORES) {
         if (__builtin_available(macOS 10.9, *)) {
             VTRegisterProfessionalVideoWorkflowVideoDecoders();
@@ -903,7 +903,7 @@  static int videotoolbox_start(AVCodecContext *avctx)
     }
 #endif
 
-#if defined(MAC_OS_VERSION_11_0) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0)
+#if __clang_major__ >= 9 && defined(MAC_OS_VERSION_11_0) && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0) && AV_HAS_BUILTIN(__builtin_available)
     if (__builtin_available(macOS 11.0, *)) {
         VTRegisterSupplementalVideoDecoderIfAvailable(videotoolbox->cm_codec_type);
     }