Go to the documentation of this file.
26 #ifndef AVUTIL_ATTRIBUTES_H
27 #define AVUTIL_ATTRIBUTES_H
30 # define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
32 # define AV_GCC_VERSION_AT_LEAST(x,y) 0
35 #ifndef av_always_inline
36 #if AV_GCC_VERSION_AT_LEAST(3,1)
37 # define av_always_inline __attribute__((always_inline)) inline
38 #elif defined(_MSC_VER)
39 # define av_always_inline __forceinline
41 # define av_always_inline inline
45 #ifndef av_extern_inline
46 #if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__)
47 # define av_extern_inline extern inline
49 # define av_extern_inline inline
53 #if AV_GCC_VERSION_AT_LEAST(3,1)
54 # define av_noinline __attribute__((noinline))
59 #if AV_GCC_VERSION_AT_LEAST(3,1)
60 # define av_pure __attribute__((pure))
66 #define av_restrict restrict
69 #if AV_GCC_VERSION_AT_LEAST(2,6)
70 # define av_const __attribute__((const))
75 #if AV_GCC_VERSION_AT_LEAST(4,3)
76 # define av_cold __attribute__((cold))
81 #if AV_GCC_VERSION_AT_LEAST(4,1)
82 # define av_flatten __attribute__((flatten))
87 #if AV_GCC_VERSION_AT_LEAST(3,1)
88 # define attribute_deprecated __attribute__((deprecated))
90 # define attribute_deprecated
98 #ifndef AV_NOWARN_DEPRECATED
99 #if AV_GCC_VERSION_AT_LEAST(4,6)
100 # define AV_NOWARN_DEPRECATED(code) \
101 _Pragma("GCC diagnostic push") \
102 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
104 _Pragma("GCC diagnostic pop")
106 # define AV_NOWARN_DEPRECATED(code) code
111 #if defined(__GNUC__)
112 # define av_unused __attribute__((unused))
122 #if AV_GCC_VERSION_AT_LEAST(3,1)
123 # define av_used __attribute__((used))
128 #if AV_GCC_VERSION_AT_LEAST(3,3)
129 # define av_alias __attribute__((may_alias))
134 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
135 # define av_uninit(x) x=x
137 # define av_uninit(x) x
141 # define av_builtin_constant_p __builtin_constant_p
142 # define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
144 # define av_builtin_constant_p(x) 0
145 # define av_printf_format(fmtpos, attrpos)
148 #if AV_GCC_VERSION_AT_LEAST(2,5)
149 # define av_noreturn __attribute__((noreturn))