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

Vladimir Pantelic vladoman
Sat Sep 18 14:11:49 CEST 2010

On 09/18/2010 01:02 PM, Axel Holzinger wrote:
> Hi all,
> if compiling FFmpeg code with zero optimisations (even without dead
> code elimination) there are linker errors (undefined references to
> functions or structs) that come from constructs like i.e. the
> following in libavcodec/allcodecs.c:
> if(CONFIG_##X##_HWACCEL) av_register_hwaccel(&x##_hwaccel); )
> The runtime (lower case) "if" leads to an undefined reference, because
> it is evaluated at runtime and not at compile time.
> If dead code eliminitation optimisation is on, this isn't an issue,
> but with optimisations completely off it is.

as far as ffmpeg is concerned, "dead code eliminitation" is a
prerequisite to build it, you cannot do without.

More information about the ffmpeg-devel mailing list