Revision 52476c1b libavutil/common.h

View differences:

libavutil/common.h
41 41
#    include <math.h>
42 42
#endif /* HAVE_AV_CONFIG_H */
43 43

  
44
#define AV_GCC_VERSION_AT_LEAST(x,y) (defined(__GNUC__) && (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y))
45

  
44 46
#ifndef av_always_inline
45
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
47
#if AV_GCC_VERSION_AT_LEAST(3,1)
46 48
#    define av_always_inline __attribute__((always_inline)) inline
47 49
#else
48 50
#    define av_always_inline inline
......
50 52
#endif
51 53

  
52 54
#ifndef av_noinline
53
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
55
#if AV_GCC_VERSION_AT_LEAST(3,1)
54 56
#    define av_noinline __attribute__((noinline))
55 57
#else
56 58
#    define av_noinline
......
58 60
#endif
59 61

  
60 62
#ifndef av_pure
61
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
63
#if AV_GCC_VERSION_AT_LEAST(3,1)
62 64
#    define av_pure __attribute__((pure))
63 65
#else
64 66
#    define av_pure
......
66 68
#endif
67 69

  
68 70
#ifndef av_const
69
#if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 5)
71
#if AV_GCC_VERSION_AT_LEAST(2,6)
70 72
#    define av_const __attribute__((const))
71 73
#else
72 74
#    define av_const
......
74 76
#endif
75 77

  
76 78
#ifndef av_cold
77
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 2)
79
#if AV_GCC_VERSION_AT_LEAST(4,3)
78 80
#    define av_cold __attribute__((cold))
79 81
#else
80 82
#    define av_cold
......
86 88
#endif /* HAVE_AV_CONFIG_H */
87 89

  
88 90
#ifndef attribute_deprecated
89
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
91
#if AV_GCC_VERSION_AT_LEAST(3,1)
90 92
#    define attribute_deprecated __attribute__((deprecated))
91 93
#else
92 94
#    define attribute_deprecated

Also available in: Unified diff