|
|
|
@ -92,10 +92,6 @@ |
|
|
|
|
type av_##name##_get_##field(const str *s) { return s->field; } \
|
|
|
|
|
void av_##name##_set_##field(str *s, type v) { s->field = v; } |
|
|
|
|
|
|
|
|
|
// Some broken preprocessors need a second expansion
|
|
|
|
|
// to be forced to tokenize __VA_ARGS__
|
|
|
|
|
#define E1(x) x |
|
|
|
|
|
|
|
|
|
/* Check if the hard coded offset of a struct member still matches reality.
|
|
|
|
|
* Induce a compilation failure if not. |
|
|
|
|
*/ |
|
|
|
@ -103,39 +99,6 @@ |
|
|
|
|
int x_##o[offsetof(s, m) == o? 1: -1]; \
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \ |
|
|
|
|
uint8_t la_##v[sizeof(t s o) + (a)]; \
|
|
|
|
|
t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a) |
|
|
|
|
|
|
|
|
|
#define LOCAL_ALIGNED_D(a, t, v, s, o, ...) \ |
|
|
|
|
DECLARE_ALIGNED(a, t, la_##v) s o; \
|
|
|
|
|
t (*v) o = la_##v |
|
|
|
|
|
|
|
|
|
#define LOCAL_ALIGNED(a, t, v, ...) LOCAL_ALIGNED_##a(t, v, __VA_ARGS__) |
|
|
|
|
|
|
|
|
|
#if HAVE_LOCAL_ALIGNED |
|
|
|
|
# define LOCAL_ALIGNED_4(t, v, ...) E1(LOCAL_ALIGNED_D(4, t, v, __VA_ARGS__,,)) |
|
|
|
|
#else |
|
|
|
|
# define LOCAL_ALIGNED_4(t, v, ...) E1(LOCAL_ALIGNED_A(4, t, v, __VA_ARGS__,,)) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if HAVE_LOCAL_ALIGNED |
|
|
|
|
# define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,)) |
|
|
|
|
#else |
|
|
|
|
# define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_A(8, t, v, __VA_ARGS__,,)) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if HAVE_LOCAL_ALIGNED |
|
|
|
|
# define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,)) |
|
|
|
|
#else |
|
|
|
|
# define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_A(16, t, v, __VA_ARGS__,,)) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if HAVE_LOCAL_ALIGNED |
|
|
|
|
# define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_D(32, t, v, __VA_ARGS__,,)) |
|
|
|
|
#else |
|
|
|
|
# define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_A(32, t, v, __VA_ARGS__,,)) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#define FF_ALLOC_TYPED_ARRAY(p, nelem) (p = av_malloc_array(nelem, sizeof(*p))) |
|
|
|
|
#define FF_ALLOCZ_TYPED_ARRAY(p, nelem) (p = av_mallocz_array(nelem, sizeof(*p))) |
|
|
|
|