[FFmpeg-devel] [PATCH] reduce redundant header inclusion

Måns Rullgård mans
Wed Jun 13 21:15:01 CEST 2007


Diego Biurrun <diego at biurrun.de> writes:

> I'd like to apply the attached patch (possibly in several steps) that
> gets rid of redundant header inclusion in several files in libavcodec.
>
> mpegvideo.h #includes dsputil.h, which in turn #includes avcodec.h.  One
> of the headers is sufficient.  OK to apply the attached patch and later
> on something that gets rid of another set of redundant avcodec.h
> #includes?

You're going about this the wrong way.  All files (source and headers)
should #include all headers they make explicit use of stuff from, even
if some of them are also indirectly included.

The idea is that every file should pull in everything it needs so as
not to depend on other files doing this.  There is no harm in the same
header being included multiple times provided they have #ifdef
protection.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list