Skip to content

Commit 9c63742

Browse files
committed
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 5858a67. [1] llvm/llvm-project@41af7c2 [2] llvm/llvm-project@274a70e Signed-off-by: Kacper Michajłow <[email protected]>
1 parent 878fb73 commit 9c63742

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libavutil/attributes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
# define av_cold
112112
#endif
113113

114-
#if AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__llvm__)
114+
#if (AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__clang__ )) || AV_HAS_ATTRIBUTE(flatten)
115115
# define av_flatten __attribute__((flatten))
116116
#else
117117
# define av_flatten

0 commit comments

Comments
 (0)