summaryrefslogtreecommitdiff
path: root/libavutil/common.h
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2008-12-20 17:33:35 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2008-12-20 17:33:35 +0000
commit52476c1beeafbb31e3277e950ec175444ece05af (patch)
treeb562f8925e9611e837f7eed9921d98e2fcbc49d0 /libavutil/common.h
parent541e8f3beccbe806599e9af4902d1e68b4367b80 (diff)
Use AV_GCC_VERSION_AT_LEAST() to simplify gcc version checks.
Originally committed as revision 16246 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/common.h')
-rw-r--r--libavutil/common.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavutil/common.h b/libavutil/common.h
index cd43abd065..83ced2d6fd 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -41,8 +41,10 @@
# include <math.h>
#endif /* HAVE_AV_CONFIG_H */
+#define AV_GCC_VERSION_AT_LEAST(x,y) (defined(__GNUC__) && (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y))
+
#ifndef av_always_inline
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
+#if AV_GCC_VERSION_AT_LEAST(3,1)
# define av_always_inline __attribute__((always_inline)) inline
#else
# define av_always_inline inline
@@ -50,7 +52,7 @@
#endif
#ifndef av_noinline
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
+#if AV_GCC_VERSION_AT_LEAST(3,1)
# define av_noinline __attribute__((noinline))
#else
# define av_noinline
@@ -58,7 +60,7 @@
#endif
#ifndef av_pure
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
+#if AV_GCC_VERSION_AT_LEAST(3,1)
# define av_pure __attribute__((pure))
#else
# define av_pure
@@ -66,7 +68,7 @@
#endif
#ifndef av_const
-#if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 5)
+#if AV_GCC_VERSION_AT_LEAST(2,6)
# define av_const __attribute__((const))
#else
# define av_const
@@ -74,7 +76,7 @@
#endif
#ifndef av_cold
-#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 2)
+#if AV_GCC_VERSION_AT_LEAST(4,3)
# define av_cold __attribute__((cold))
#else
# define av_cold
@@ -86,7 +88,7 @@
#endif /* HAVE_AV_CONFIG_H */
#ifndef attribute_deprecated
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
+#if AV_GCC_VERSION_AT_LEAST(3,1)
# define attribute_deprecated __attribute__((deprecated))
#else
# define attribute_deprecated