From a37903bc439b9fa7d8aa6db27547f3d04eb12bb2 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Mon, 2 Feb 2004 09:18:40 +0000 Subject: [PATCH] * include/stdio.h (feof): Add inlined definition. (ferror): Ditto. --- winsup/mingw/ChangeLog | 5 +++++ winsup/mingw/include/stdio.h | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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*);