From 9c63742425aa9c84148f218513f74dbab1e01926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 22 Mar 2026 14:26:40 +0100 Subject: [PATCH] avutil/attributes: enable av_flatten when available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This enables av_flatten on Clang in particular. It was disabled because at the time this attribute was not supported. It was implemented in Clang/LLVM 3.5 [1]. Use `__has_attribute` to check for availability. This has been added in Clang 2.9 [2]. This reverts change 5858a67f135a7395c548482c73cf3d39bcdd3022. [1] https://github.com/llvm/llvm-project/commit/41af7c2fdc8cc2ef186669dcb21cac58d5bd69ee [2] https://github.com/llvm/llvm-project/commit/274a70ed7f4315c83273173fce4c3b0e097958d6 Signed-off-by: Kacper Michajłow --- libavutil/attributes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/attributes.h b/libavutil/attributes.h index 0e49b22b9d..c9c74c28b6 100644 --- a/libavutil/attributes.h +++ b/libavutil/attributes.h @@ -111,7 +111,7 @@ # define av_cold #endif -#if AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__llvm__) +#if (AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__clang__ )) || AV_HAS_ATTRIBUTE(flatten) # define av_flatten __attribute__((flatten)) #else # define av_flatten