diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index bd57ce6b4..8d9592f32 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,8 @@ +2004-02-02 Danny Smith + + * include/stdio.h (feof): Add inlined definition. + (ferror): Ditto. + 2004-02-01 Danny Smith * mingwex/math/ldexpl.c (ldexpl): Call __asm__("fscale") diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h index 43c4f991f..84b3b1087 100644 --- a/winsup/mingw/include/stdio.h +++ b/winsup/mingw/include/stdio.h @@ -352,9 +352,20 @@ _CRTIMP int __cdecl fsetpos (FILE*, const fpos_t*); * Error Functions */ -_CRTIMP void __cdecl clearerr (FILE*); _CRTIMP int __cdecl feof (FILE*); _CRTIMP int __cdecl ferror (FILE*); + +#ifdef __cplusplus +inline int __cdecl feof (FILE* __F) + { return __F->_flag & _IOEOF; } +inline int __cdecl ferror (FILE* __F) + { return __F->_flag & _IOERR; } +#else +#define feof(__F) ((__F)->_flag & _IOEOF) +#define ferror(__F) ((__F)->_flag & _IOERR) +#endif + +_CRTIMP void __cdecl clearerr (FILE*); _CRTIMP void __cdecl perror (const char*);