Go to the documentation of this file.
21 #ifndef AVUTIL_MEM_INTERNAL_H
22 #define AVUTIL_MEM_INTERNAL_H
78 #if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
79 #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
80 #define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
81 #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
82 #elif defined(__DJGPP__)
83 #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v
84 #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
85 #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
86 #elif defined(__GNUC__) || defined(__clang__)
87 #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
88 #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v
89 #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
90 #elif defined(_MSC_VER)
91 #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
92 #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v
93 #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
95 #define DECLARE_ALIGNED(n,t,v) t v
96 #define DECLARE_ASM_ALIGNED(n,t,v) t v
97 #define DECLARE_ASM_CONST(n,t,v) static const t v
104 #define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
105 uint8_t la_##v[sizeof(t s o) + (a)]; \
106 t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
108 #define LOCAL_ALIGNED_D(a, t, v, s, o, ...) \
109 DECLARE_ALIGNED(a, t, la_##v) s o; \
112 #define LOCAL_ALIGNED(a, t, v, ...) LOCAL_ALIGNED_##a(t, v, __VA_ARGS__)
114 #if HAVE_LOCAL_ALIGNED
115 # define LOCAL_ALIGNED_4(t, v, ...) E1(LOCAL_ALIGNED_D(4, t, v, __VA_ARGS__,,))
117 # define LOCAL_ALIGNED_4(t, v, ...) E1(LOCAL_ALIGNED_A(4, t, v, __VA_ARGS__,,))
120 #if HAVE_LOCAL_ALIGNED
121 # define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
123 # define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_A(8, t, v, __VA_ARGS__,,))
126 #if HAVE_LOCAL_ALIGNED
127 # define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
129 # define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_A(16, t, v, __VA_ARGS__,,))
132 #if HAVE_LOCAL_ALIGNED
133 # define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_D(32, t, v, __VA_ARGS__,,))
135 # define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_A(32, t, v, __VA_ARGS__,,))