Revision 52476c1b

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
libavutil/internal.h
33 33
#include <stdint.h>
34 34
#include <stddef.h>
35 35
#include <assert.h>
36
#include "common.h"
36 37

  
37 38
#ifndef attribute_align_arg
38
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__>1)
39
#if AV_GCC_VERSION_AT_LEAST(4,2)
39 40
#    define attribute_align_arg __attribute__((force_align_arg_pointer))
40 41
#else
41 42
#    define attribute_align_arg
......
43 44
#endif
44 45

  
45 46
#ifndef attribute_used
46
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
47
#if AV_GCC_VERSION_AT_LEAST(3,1)
47 48
#    define attribute_used __attribute__((used))
48 49
#else
49 50
#    define attribute_used
libavutil/mem.h
26 26
#ifndef AVUTIL_MEM_H
27 27
#define AVUTIL_MEM_H
28 28

  
29
#include "common.h"
30

  
29 31
#if defined(__ICC) || defined(__SUNPRO_C)
30 32
    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
31 33
    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
......
42 44
    #define DECLARE_ASM_CONST(n,t,v)    static const t v
43 45
#endif
44 46

  
45
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
47
#if AV_GCC_VERSION_AT_LEAST(3,1)
46 48
    #define av_malloc_attrib __attribute__((__malloc__))
47 49
#else
48 50
    #define av_malloc_attrib
49 51
#endif
50 52

  
51
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 2)
53
#if AV_GCC_VERSION_AT_LEAST(4,3)
52 54
    #define av_alloc_size(n) __attribute__((alloc_size(n)))
53 55
#else
54 56
    #define av_alloc_size(n)

Also available in: Unified diff