[MPlayer-dev-eng] osdep/fseeko.c ifndef sense reversed?
D Richard Felker III
dalias at aerifal.cx
Sun Apr 4 07:08:30 CEST 2004
On Sat, Apr 03, 2004 at 08:47:27PM -0800, Steven M. Schultz wrote:
> Hi -
>
> In osdep/fseeko.c there are, now, two references to
> '#ifndef __MINGW32__' that have, I think, the sense of the ifdef
> is reversed:
>
> #ifndef __MINGW32__
> off_t floc;
> #else
> fpos_t floc;
> #endif
>
> SHOULD be:
>
> #ifdef __MINGW32__
> off_t floc;
> #else
> fpos_t floc;
> #endif
>
> Why? Because the 'floc' variable is used with fsetpos() and fgetpos()
> and those are prototyped thus (according to "man fsetpos"):
>
> int fgetpos(FILE *stream, fpos_t *pos);
> int fsetpos(FILE *stream, fpos_t *pos);
>
> If MINGW32 needs off_t instead of fpos_t that's fine but the #ifndef
> needs to be reversed to #ifdef in that case. As it is now all systems
> EXCEPT __MINGW32__ will get off_t rather than fpos_t and that
> disagrees with the prototype.
Sounds right. Further, the whole code block is dumb. Instead something
like this should be at the top of the file:
#ifdef __MINGW32__
typedef off_t fpos_t
#endif
Rich
More information about the MPlayer-dev-eng
mailing list