comparison common.h @ 630:fb04e2fc189c libavutil

Reorganize header #includes: Unconditionally #include standard C headers, group all local #includes together.
author diego
date Sun, 25 Jan 2009 23:21:02 +0000
parents c309f86c05a2
children 8c48a1b999a3
comparison
equal deleted inserted replaced
629:097c9438d7f4 630:fb04e2fc189c
24 */ 24 */
25 25
26 #ifndef AVUTIL_COMMON_H 26 #ifndef AVUTIL_COMMON_H
27 #define AVUTIL_COMMON_H 27 #define AVUTIL_COMMON_H
28 28
29 #include <ctype.h>
30 #include <errno.h>
29 #include <inttypes.h> 31 #include <inttypes.h>
30 32 #include <limits.h>
31 #ifdef HAVE_AV_CONFIG_H 33 #include <math.h>
32 /* only include the following when compiling package */ 34 #include <stdio.h>
33 # include "config.h" 35 #include <stdlib.h>
34 36 #include <string.h>
35 # include <stdlib.h>
36 # include <stdio.h>
37 # include <string.h>
38 # include <ctype.h>
39 # include <limits.h>
40 # include <errno.h>
41 # include <math.h>
42 #endif /* HAVE_AV_CONFIG_H */
43 37
44 #define AV_GCC_VERSION_AT_LEAST(x,y) (defined(__GNUC__) && (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)) 38 #define AV_GCC_VERSION_AT_LEAST(x,y) (defined(__GNUC__) && (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y))
45 39
46 #ifndef av_always_inline 40 #ifndef av_always_inline
47 #if AV_GCC_VERSION_AT_LEAST(3,1) 41 #if AV_GCC_VERSION_AT_LEAST(3,1)
96 # define av_unused __attribute__((unused)) 90 # define av_unused __attribute__((unused))
97 #else 91 #else
98 # define av_unused 92 # define av_unused
99 #endif 93 #endif
100 #endif 94 #endif
101
102 #include "mem.h"
103 95
104 //rounded divison & shift 96 //rounded divison & shift
105 #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) 97 #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
106 /* assume b>0 */ 98 /* assume b>0 */
107 #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) 99 #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
262 PUT_BYTE\ 254 PUT_BYTE\
263 }\ 255 }\
264 }\ 256 }\
265 } 257 }
266 258
259 #include "mem.h"
260
267 #ifdef HAVE_AV_CONFIG_H 261 #ifdef HAVE_AV_CONFIG_H
262 # include "config.h"
268 # include "internal.h" 263 # include "internal.h"
269 #endif /* HAVE_AV_CONFIG_H */ 264 #endif /* HAVE_AV_CONFIG_H */
270 265
271 #endif /* AVUTIL_COMMON_H */ 266 #endif /* AVUTIL_COMMON_H */