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] 41af7c2fdc
[2] 274a70ed7f

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

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