diff options
Diffstat (limited to 'mpcommon.h')
-rw-r--r-- | mpcommon.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mpcommon.h b/mpcommon.h index 87f074c6f2..d4ececc4b1 100644 --- a/mpcommon.h +++ b/mpcommon.h @@ -26,6 +26,8 @@ #define ROUND(x) ((int)((x) < 0 ? (x) - 0.5 : (x) + 0.5)) +#define MP_EXPAND_ARGS(...) __VA_ARGS__ + #define MP_TALLOC_ELEMS(p) (talloc_get_size(p) / sizeof((p)[0])) #define MP_GROW_ARRAY(p, nextidx) do { \ if ((nextidx) == MP_TALLOC_ELEMS(p)) \ @@ -43,15 +45,13 @@ (nextidx_ + 1) * sizeof((p)[0]) * 2);\ } while (0) -#define MP_TARRAY_APPEND(ctx, p, idxvar, val) \ +#define MP_TARRAY_APPEND(ctx, p, idxvar, ...) \ do { \ MP_TARRAY_GROW(ctx, p, idxvar); \ - p[idxvar] = (val); \ + p[idxvar] = (MP_EXPAND_ARGS(__VA_ARGS__)); \ idxvar++; \ } while (0) -#define MP_EXPAND_ARGS(...) __VA_ARGS__ - #define talloc_struct(ctx, type, ...) \ talloc_memdup(ctx, &(type) MP_EXPAND_ARGS(__VA_ARGS__), sizeof(type)) |