[MPlayer-dev-eng] [PATCH] MinGW compile fix, header order policy suggestion

Ivan Kalvachev ikalvachev at gmail.com
Tue May 31 11:26:55 CEST 2005


On 5/30/05, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> Hi,
> the attached patch changes the order of the header in some files so that
> system headers always come first. The point is that windows headers
> define a STREAM_SEEK, too (in the way typedef struct ... STREAM_SEEK),
> if in this case our STREAM_SEEK is already defined it won't compile.
> I'd also suggest to adding something like: "you should first #include
> config.h, then any system header and last the MPlayer specific one. If
> can't do it like this for some reason, comment it in the code!"
> to the CVS policy.
> What do you think?
> 
> Greetings,
> Reimar Döffinger

I don't think this needs to be enforced because it is an good
programer writing style.
Actually in mplayer some headers doesn't include the system headers
they need, this way forcing the right order.

As for the current situation, fixing this way is even worse than not
fixing it. The right way is to avoid all possible collisions and
change STREAM_SEEK to MP_STREAM_SEEK. Otherwise the assigned value may
be same as another defined STREAM_* label that would be produce an
VERY hard to track bugs. The only clue we may find for this bug, is an
warning that is hidden in the 200k warnings mplayer emits. There could
be an even worse situation as STREAM_SEEK may not be defined as value
or constant...

Wish You Best
   Ivan Kalvachev
  iive




More information about the MPlayer-dev-eng mailing list