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

matthieu castet castet.matthieu
Sat Sep 18 18:48:35 CEST 2010


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 :

static inline av_register_hwaccel() {}

But I am not sure it is worth it.

Matthieu




More information about the ffmpeg-devel mailing list