comparison mem.h @ 590:e9d89a89561a libavutil

Use AV_GCC_VERSION_AT_LEAST() to simplify gcc version checks.
author cehoyos
date Sat, 20 Dec 2008 17:33:35 +0000
parents 5e52a169969c
children 5fe37f8a1017
comparison
equal deleted inserted replaced
589:9dd4312d8a4d 590:e9d89a89561a
24 */ 24 */
25 25
26 #ifndef AVUTIL_MEM_H 26 #ifndef AVUTIL_MEM_H
27 #define AVUTIL_MEM_H 27 #define AVUTIL_MEM_H
28 28
29 #include "common.h"
30
29 #if defined(__ICC) || defined(__SUNPRO_C) 31 #if defined(__ICC) || defined(__SUNPRO_C)
30 #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n))) 32 #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
31 #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v 33 #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
32 #elif defined(__GNUC__) 34 #elif defined(__GNUC__)
33 #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n))) 35 #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
40 #else 42 #else
41 #define DECLARE_ALIGNED(n,t,v) t v 43 #define DECLARE_ALIGNED(n,t,v) t v
42 #define DECLARE_ASM_CONST(n,t,v) static const t v 44 #define DECLARE_ASM_CONST(n,t,v) static const t v
43 #endif 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 #define av_malloc_attrib __attribute__((__malloc__)) 48 #define av_malloc_attrib __attribute__((__malloc__))
47 #else 49 #else
48 #define av_malloc_attrib 50 #define av_malloc_attrib
49 #endif 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 #define av_alloc_size(n) __attribute__((alloc_size(n))) 54 #define av_alloc_size(n) __attribute__((alloc_size(n)))
53 #else 55 #else
54 #define av_alloc_size(n) 56 #define av_alloc_size(n)
55 #endif 57 #endif
56 58