]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/common.h
Fix warnings in tree.c test code.
[ffmpeg] / libavutil / common.h
index 5dcc40decbdc79b85d6989544568b5b3278b5416..15eaf9849d81d43e6e6e9a25fdd997f802754d70 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 /**
- * @file common.h
+ * @file libavutil/common.h
  * common internal and external API header
  */
 
 #include <stdlib.h>
 #include <string.h>
 
-#define AV_GCC_VERSION_AT_LEAST(x,y) (defined(__GNUC__) && (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y))
+#ifdef __GNUC__
+#    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
+#else
+#    define AV_GCC_VERSION_AT_LEAST(x,y) 0
+#endif
 
 #ifndef av_always_inline
 #if AV_GCC_VERSION_AT_LEAST(3,1)
 #endif
 #endif
 
+#ifndef av_flatten
+#if AV_GCC_VERSION_AT_LEAST(4,1)
+#    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))
 #endif
 #endif
 
+#ifndef av_uninit
+#if defined(__GNUC__) && !defined(__ICC)
+#    define av_uninit(x) x=x
+#else
+#    define av_uninit(x) x
+#endif
+#endif
+
 //rounded division & shift
 #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
 /* assume b>0 */