[FFmpeg-devel] [PATCH] Make DECLARE_ALIGNED macros take array specifiers as separate argument

Uoti Urpala uoti.urpala
Wed Jan 20 22:42:35 CET 2010


On Wed, 2010-01-20 at 22:30 +0100, Reimar D?ffinger wrote:
> On Wed, Jan 20, 2010 at 09:08:13PM +0000, Mans Rullgard wrote:
> >  void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
> >  void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
> >  
> > -#define DECLARE_ALIGNED_16(t, v) DECLARE_ALIGNED(16, t, v)
> > -#define DECLARE_ALIGNED_8(t, v)  DECLARE_ALIGNED(8, t, v)
> > +#define DECLARE_ALIGNED_16(t, v, ...) DECLARE_ALIGNED(16, t, v, __VA_ARGS__)
> > +#define DECLARE_ALIGNED_8(t, v, ...)  DECLARE_ALIGNED(8, t, v, __VA_ARGS__)
> 
> Sorry for being a pain, but doesn't this kind of macro strictly not allow you
> to use DECLARE_ALIGNED_16 with only two arguments?
> At least gcc still complains about it with -pedantic

In this case it could be fixed by moving at least one required argument
into the variable part, as in
#define DECLARE_ALIGNED_16(t, ...) DECLARE_ALIGNED(16, t, __VA_ARGS__)
or
#define DECLARE_ALIGNED_16(...) DECLARE_ALIGNED(16, __VA_ARGS__)




More information about the ffmpeg-devel mailing list