[MPlayer-dev-eng] [PATCH] img_format.h needs config.h
Ivan Kalvachev
ikalvachev at gmail.com
Thu Feb 9 11:25:04 CET 2006
2006/2/9, Alan Curry <pacman at theworld.com>:
> img_format.h defines the IMGFMT_* constants differently based on #ifdef
> WORDS_BIGENDIAN, but it doesn't include config.h which is where
> WORDS_BIGENDIAN comes from. So anyone who includes img_format.h without
> having included config.h first gets the wrong definitions on bigendian.
>
> One such place is img_format.c! vo_format_name() actually returns the wrong
> names for ARGB/ABGR because it's using the wrong constants.
>
> The easy way to prevent such problems is to include config.h directly at the
> top of img_format.h
There was a recomendation to avoid recursive inclusion of header files.
This way all .h are clearly visible in the begginging of the file.
Otherwise each .h file must contain protection against multiple
inclusion and redefinition. You know in C redefining of function
prototype is not allowed).
AFAIK there are not function prototypes in config.h, but...
Anyway img_format.c fixed by adding config.h in the beggining.
More information about the MPlayer-dev-eng
mailing list