[FFmpeg-devel] Moving if(constant expression) to preprocessor?

Axel Holzinger aholzinger
Sat Sep 18 18:58:38 CEST 2010


matthieu castet wrote:
> Axel Holzinger <aholzinger <at> gmx.de> writes:
> 
> > 
> > Hi M?ns and all,
> > 
> > 
> > You could leave this up to me or others.
> > 
> > It is possible to write a macro that does the trick and in 
> the end the 
> > above line would for example look like this:
> > 
> > AV_COND_IF(CONFIG_##X##_HWACCEL, 
> (av_register_hwaccel(&x##_hwaccel)),)
> > ; }
> > 
> > Wouldn't that still be fine? And it could be done with a 
> few lines of 
> > generic macro defintions that could go to some generic header.
> > 
> > What would be the disadvantage?
> > 
> An other solution is to provide stub function of disabled code :

That's exactly what I wrote in my reply to Reimar's post.

> static inline av_register_hwaccel() {}
> 
> But I am not sure it is worth it.

The preprocessor thing would be much less effort.

And it works also for the cases where it's struct objects that are not
defined.

Cheers
Axel




More information about the ffmpeg-devel mailing list