]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/attributes.h
vp9mc/x86: add 16px functions (64bit only).
[ffmpeg] / libavutil / attributes.h
index ef990a1d4f45c3453c4c3d44cf3547a667c43469..c770f52a432deec0e40be7d0a058057668cb1563 100644 (file)
 #    define AV_GCC_VERSION_AT_LEAST(x,y) 0
 #endif
 
-#ifndef av_always_inline
 #if AV_GCC_VERSION_AT_LEAST(3,1)
 #    define av_always_inline __attribute__((always_inline)) inline
+#elif defined(_MSC_VER)
+#    define av_always_inline __forceinline
 #else
 #    define av_always_inline inline
 #endif
-#endif
 
-#ifndef av_noinline
 #if AV_GCC_VERSION_AT_LEAST(3,1)
 #    define av_noinline __attribute__((noinline))
+#elif defined(_MSC_VER)
+#    define av_noinline __declspec(noinline)
 #else
 #    define av_noinline
 #endif
-#endif
 
-#ifndef av_pure
 #if AV_GCC_VERSION_AT_LEAST(3,1)
 #    define av_pure __attribute__((pure))
 #else
 #    define av_pure
 #endif
-#endif
 
-#ifndef av_const
 #if AV_GCC_VERSION_AT_LEAST(2,6)
 #    define av_const __attribute__((const))
 #else
 #    define av_const
 #endif
-#endif
 
-#ifndef av_cold
 #if AV_GCC_VERSION_AT_LEAST(4,3)
 #    define av_cold __attribute__((cold))
 #else
 #    define av_cold
 #endif
-#endif
 
-#ifndef av_flatten
-#if AV_GCC_VERSION_AT_LEAST(4,1)
+#if AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__llvm__)
 #    define av_flatten __attribute__((flatten))
 #else
 #    define av_flatten
 #endif
-#endif
 
-#ifndef attribute_deprecated
 #if AV_GCC_VERSION_AT_LEAST(3,1)
 #    define attribute_deprecated __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#    define attribute_deprecated __declspec(deprecated)
 #else
 #    define attribute_deprecated
 #endif
-#endif
 
-#ifndef av_unused
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__clang__)
 #    define av_unused __attribute__((unused))
 #else
 #    define av_unused
 #endif
-#endif
 
 /**
  * Mark a variable as used and prevent the compiler from optimizing it
  * away.  This is useful for variables accessed only from inline
  * assembler without the compiler being aware.
  */
-#ifndef av_used
-#if AV_GCC_VERSION_AT_LEAST(3,1)
+#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
 #    define av_used __attribute__((used))
 #else
 #    define av_used
 #endif
-#endif
 
-#ifndef av_alias
 #if AV_GCC_VERSION_AT_LEAST(3,3)
 #   define av_alias __attribute__((may_alias))
 #else
 #   define av_alias
 #endif
-#endif
 
-#ifndef av_uninit
 #if defined(__GNUC__) && !defined(__ICC)
 #    define av_uninit(x) x=x
 #else
 #    define av_uninit(x) x
 #endif
-#endif
 
 #ifdef __GNUC__
 #    define av_builtin_constant_p __builtin_constant_p
 #    define av_printf_format(fmtpos, attrpos)
 #endif
 
+#if AV_GCC_VERSION_AT_LEAST(2,5)
+#    define av_noreturn __attribute__((noreturn))
+#else
+#    define av_noreturn
+#endif
+
 #endif /* AVUTIL_ATTRIBUTES_H */