From 941eae01b1c4ed5d50eb5934e7df8a8a110e1699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Thu, 25 Sep 2025 19:24:19 +0200 Subject: [PATCH] avutil/attributes: prefer clang attributes even in non-gnu builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In MSVC mode Clang doesn't define __GNUC__, but we can still attributes. Signed-off-by: Kacper Michajłow --- libavutil/attributes.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavutil/attributes.h b/libavutil/attributes.h index 993ec6e1da..772e327fa4 100644 --- a/libavutil/attributes.h +++ b/libavutil/attributes.h @@ -49,7 +49,7 @@ #endif #ifndef av_always_inline -#if AV_GCC_VERSION_AT_LEAST(3,1) +#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__) # define av_always_inline __attribute__((always_inline)) inline #elif defined(_MSC_VER) # define av_always_inline __forceinline @@ -68,13 +68,13 @@ #if AV_HAS_STD_ATTRIBUTE(nodiscard) # define av_warn_unused_result [[nodiscard]] -#elif AV_GCC_VERSION_AT_LEAST(3,4) +#elif AV_GCC_VERSION_AT_LEAST(3,4) || defined(__clang__) # define av_warn_unused_result __attribute__((warn_unused_result)) #else # define av_warn_unused_result #endif -#if AV_GCC_VERSION_AT_LEAST(3,1) +#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__) # define av_noinline __attribute__((noinline)) #elif defined(_MSC_VER) # define av_noinline __declspec(noinline) @@ -108,7 +108,7 @@ #if AV_HAS_STD_ATTRIBUTE(deprecated) # define attribute_deprecated [[deprecated]] -#elif AV_GCC_VERSION_AT_LEAST(3,1) +#elif AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__) # define attribute_deprecated __attribute__((deprecated)) #elif defined(_MSC_VER) # define attribute_deprecated __declspec(deprecated)