[FFmpeg-devel] [PATCH] fix compilation (was Re: r12489 broke all builds)

Måns Rullgård mans
Wed Mar 19 09:38:43 CET 2008


Michael Niedermayer <michaelni at gmx.at> writes:

> On Wed, Mar 19, 2008 at 11:08:56AM +0800, Zuxy Meng wrote:
>> Hi,
>> 
>> 2008/3/19, Benoit Fouet <benoit.fouet at purplelabs.com>:
>> > Michael Niedermayer wrote:
>> > > On Tue, Mar 18, 2008 at 12:22:41PM -0400, Alexander Strange wrote:
>> > >
>> > >> On Mar 18, 2008, at 12:13 PM, Mike Melanson wrote:
>> > >>
>> > >>> Check FATE:
>> > >>>
>> > >>>  http://fate.multimedia.cx/
>> > >>>
>> > >>> --
>> > >>>     -Mike Melanson
>> > >>>
>> > >> Missing include in rational.h.
>> > >>
>> > >
>> > > ok
>> > >
>> > >
>> >
>> > as already mentionned, I'll let Zuxy apply this one along with his patch.
>> > again, sorry for this bad commit :(
>> 
>> I should have run a distclean before building and sending the patch.

Run make checkheaders too.

>> Anyway now we have 3 ways to fix the build:
>> 
>> 1. Include "common.h" in "rational.h"
>> 2. Include "common.h" in "mpeg12data.h"
>> 3. Include "common.h" in "mpeg12data.c"
>> 
>> The only .c file that failed to compile is mpeg12data.c. All other
>> files that use "rational.h" have included "common.h" either directly
>> or indirectly.
>> 
>> Maybe Diego can point to me the cleanest approach?

Include common.h in rational.h.  This is, er, rational since symbols
from common.h are needed by rational.h.  Relying on someone else to
include prerequisites is bad programming practise.

> The cleanest approuch is to never include headers from other headers.

Wherever did you get that notion?  It is pure madness.  If you
disagree, come visit me at my dayjob, where some madmen operated under
that rule for years.  The resulting chaos is hard to imagine.

> But i suspect that i, ivan and arpi are in the minority with that view.

I didn't know you were that many.

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




More information about the ffmpeg-devel mailing list