annotate attributes.h @ 992:a13125b5be3a libavutil

bswap: change ME to NE in macro names Other parts of FFmpeg use NE (native endian) rather than ME (machine). This makes it consistent.
author mru
date Sat, 10 Jul 2010 22:09:01 +0000
parents 074893f9f95e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
866
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
1 /*
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
2 * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
3 *
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
4 * This file is part of FFmpeg.
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
5 *
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
10 *
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
14 * Lesser General Public License for more details.
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
15 *
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
19 */
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
20
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
21 /**
899
0795a743bda1 Remove explicit filename from Doxygen @file commands.
diego
parents: 895
diff changeset
22 * @file
866
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
23 * Macro definitions for various function/variable attributes
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
24 */
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
25
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
26 #ifndef AVUTIL_ATTRIBUTES_H
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
27 #define AVUTIL_ATTRIBUTES_H
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
28
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
29 #ifdef __GNUC__
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
30 # define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
31 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
32 # define AV_GCC_VERSION_AT_LEAST(x,y) 0
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
33 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
34
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
35 #ifndef av_always_inline
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
36 #if AV_GCC_VERSION_AT_LEAST(3,1)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
37 # define av_always_inline __attribute__((always_inline)) inline
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
38 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
39 # define av_always_inline inline
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
40 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
41 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
42
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
43 #ifndef av_noinline
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
44 #if AV_GCC_VERSION_AT_LEAST(3,1)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
45 # define av_noinline __attribute__((noinline))
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
46 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
47 # define av_noinline
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
48 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
49 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
50
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
51 #ifndef av_pure
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
52 #if AV_GCC_VERSION_AT_LEAST(3,1)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
53 # define av_pure __attribute__((pure))
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
54 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
55 # define av_pure
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
56 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
57 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
58
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
59 #ifndef av_const
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
60 #if AV_GCC_VERSION_AT_LEAST(2,6)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
61 # define av_const __attribute__((const))
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
62 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
63 # define av_const
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
64 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
65 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
66
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
67 #ifndef av_cold
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
68 #if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
69 # define av_cold __attribute__((cold))
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
70 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
71 # define av_cold
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
72 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
73 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
74
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
75 #ifndef av_flatten
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
76 #if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,1)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
77 # define av_flatten __attribute__((flatten))
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
78 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
79 # define av_flatten
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
80 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
81 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
82
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
83 #ifndef attribute_deprecated
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
84 #if AV_GCC_VERSION_AT_LEAST(3,1)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
85 # define attribute_deprecated __attribute__((deprecated))
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
86 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
87 # define attribute_deprecated
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
88 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
89 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
90
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
91 #ifndef av_unused
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
92 #if defined(__GNUC__)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
93 # define av_unused __attribute__((unused))
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
94 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
95 # define av_unused
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
96 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
97 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
98
919
074893f9f95e av_alias is an attribute and belongs to attributes.h
michael
parents: 899
diff changeset
99 #ifndef av_alias
074893f9f95e av_alias is an attribute and belongs to attributes.h
michael
parents: 899
diff changeset
100 #if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(3,3)
074893f9f95e av_alias is an attribute and belongs to attributes.h
michael
parents: 899
diff changeset
101 # define av_alias __attribute__((may_alias))
074893f9f95e av_alias is an attribute and belongs to attributes.h
michael
parents: 899
diff changeset
102 #else
074893f9f95e av_alias is an attribute and belongs to attributes.h
michael
parents: 899
diff changeset
103 # define av_alias
074893f9f95e av_alias is an attribute and belongs to attributes.h
michael
parents: 899
diff changeset
104 #endif
074893f9f95e av_alias is an attribute and belongs to attributes.h
michael
parents: 899
diff changeset
105 #endif
074893f9f95e av_alias is an attribute and belongs to attributes.h
michael
parents: 899
diff changeset
106
866
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
107 #ifndef av_uninit
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
108 #if defined(__GNUC__) && !defined(__ICC)
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
109 # define av_uninit(x) x=x
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
110 #else
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
111 # define av_uninit(x) x
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
112 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
113 #endif
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
114
895
6ea86beeedb2 av_builtin_constant_p()
michael
parents: 866
diff changeset
115 #ifdef __GNUC__
6ea86beeedb2 av_builtin_constant_p()
michael
parents: 866
diff changeset
116 # define av_builtin_constant_p __builtin_constant_p
6ea86beeedb2 av_builtin_constant_p()
michael
parents: 866
diff changeset
117 #else
6ea86beeedb2 av_builtin_constant_p()
michael
parents: 866
diff changeset
118 # define av_builtin_constant_p(x) 0
6ea86beeedb2 av_builtin_constant_p()
michael
parents: 866
diff changeset
119 #endif
6ea86beeedb2 av_builtin_constant_p()
michael
parents: 866
diff changeset
120
866
efba70214ef1 Move gcc attribute macros to new header libavutil/attributes.h
mru
parents:
diff changeset
121 #endif /* AVUTIL_ATTRIBUTES_H */