avutil/attributes: enable av_flatten when available

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 5858a67f13.

[1] https://github.com/llvm/llvm-project/commit/41af7c2fdc8cc2ef186669dcb21cac58d5bd69ee
[2] https://github.com/llvm/llvm-project/commit/274a70ed7f4315c83273173fce4c3b0e097958d6

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
Kacper Michajłow
2026-03-22 14:26:40 +01:00
parent 878fb73135
commit 9c63742425
+1 -1
View File
@@ -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