| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#ifndef AVUTIL_ATTRIBUTES_H |
| 27 |
#define AVUTIL_ATTRIBUTES_H |
| 28 |
|
| 29 |
#ifdef __GNUC__ |
| 30 |
# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y) |
| 31 |
#else |
| 32 |
# define AV_GCC_VERSION_AT_LEAST(x,y) 0 |
| 33 |
#endif |
| 34 |
|
| 35 |
#ifndef av_always_inline |
| 36 |
#if AV_GCC_VERSION_AT_LEAST(3,1) |
| 37 |
# define av_always_inline __attribute__((always_inline)) inline |
| 38 |
#else |
| 39 |
# define av_always_inline inline |
| 40 |
#endif |
| 41 |
#endif |
| 42 |
|
| 43 |
#ifndef av_noinline |
| 44 |
#if AV_GCC_VERSION_AT_LEAST(3,1) |
| 45 |
# define av_noinline __attribute__((noinline)) |
| 46 |
#else |
| 47 |
# define av_noinline |
| 48 |
#endif |
| 49 |
#endif |
| 50 |
|
| 51 |
#ifndef av_pure |
| 52 |
#if AV_GCC_VERSION_AT_LEAST(3,1) |
| 53 |
# define av_pure __attribute__((pure)) |
| 54 |
#else |
| 55 |
# define av_pure |
| 56 |
#endif |
| 57 |
#endif |
| 58 |
|
| 59 |
#ifndef av_const |
| 60 |
#if AV_GCC_VERSION_AT_LEAST(2,6) |
| 61 |
# define av_const __attribute__((const)) |
| 62 |
#else |
| 63 |
# define av_const |
| 64 |
#endif |
| 65 |
#endif |
| 66 |
|
| 67 |
#ifndef av_cold |
| 68 |
#if AV_GCC_VERSION_AT_LEAST(4,3) |
| 69 |
# define av_cold __attribute__((cold)) |
| 70 |
#else |
| 71 |
# define av_cold |
| 72 |
#endif |
| 73 |
#endif |
| 74 |
|
| 75 |
#ifndef av_flatten |
| 76 |
#if AV_GCC_VERSION_AT_LEAST(4,1) |
| 77 |
# define av_flatten __attribute__((flatten)) |
| 78 |
#else |
| 79 |
# define av_flatten |
| 80 |
#endif |
| 81 |
#endif |
| 82 |
|
| 83 |
#ifndef attribute_deprecated |
| 84 |
#if AV_GCC_VERSION_AT_LEAST(3,1) |
| 85 |
# define attribute_deprecated __attribute__((deprecated)) |
| 86 |
#else |
| 87 |
# define attribute_deprecated |
| 88 |
#endif |
| 89 |
#endif |
| 90 |
|
| 91 |
#ifndef av_unused |
| 92 |
#if defined(__GNUC__) |
| 93 |
# define av_unused __attribute__((unused)) |
| 94 |
#else |
| 95 |
# define av_unused |
| 96 |
#endif |
| 97 |
#endif |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
#ifndef av_used |
| 105 |
#if AV_GCC_VERSION_AT_LEAST(3,1) |
| 106 |
# define av_used __attribute__((used)) |
| 107 |
#else |
| 108 |
# define av_used |
| 109 |
#endif |
| 110 |
#endif |
| 111 |
|
| 112 |
#ifndef av_alias |
| 113 |
#if AV_GCC_VERSION_AT_LEAST(3,3) |
| 114 |
# define av_alias __attribute__((may_alias)) |
| 115 |
#else |
| 116 |
# define av_alias |
| 117 |
#endif |
| 118 |
#endif |
| 119 |
|
| 120 |
#ifndef av_uninit |
| 121 |
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) |
| 122 |
# define av_uninit(x) x=x |
| 123 |
#else |
| 124 |
# define av_uninit(x) x |
| 125 |
#endif |
| 126 |
#endif |
| 127 |
|
| 128 |
#ifdef __GNUC__ |
| 129 |
# define av_builtin_constant_p __builtin_constant_p |
| 130 |
# define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos))) |
| 131 |
#else |
| 132 |
# define av_builtin_constant_p(x) 0 |
| 133 |
# define av_printf_format(fmtpos, attrpos) |
| 134 |
#endif |
| 135 |
|
| 136 |
#endif |