aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2004-02-02 09:18:40 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2004-02-02 09:18:40 +0000
commita37903bc439b9fa7d8aa6db27547f3d04eb12bb2 (patch)
tree574ac2905ddd2cd0f00bb582d29d37a493f91333
parent9512474d4d3275d285b1bf22428dbadc32ba2260 (diff)
downloadnewlib-a37903bc439b9fa7d8aa6db27547f3d04eb12bb2.zip
newlib-a37903bc439b9fa7d8aa6db27547f3d04eb12bb2.tar.gz
newlib-a37903bc439b9fa7d8aa6db27547f3d04eb12bb2.tar.bz2
* include/stdio.h (feof): Add inlined definition.
(ferror): Ditto.
-rw-r--r--winsup/mingw/ChangeLog5
-rw-r--r--winsup/mingw/include/stdio.h13
2 files changed, 17 insertions, 1 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index bd57ce6..8d9592f 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-02 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/stdio.h (feof): Add inlined definition.
+ (ferror): Ditto.
+
2004-02-01 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/math/ldexpl.c (ldexpl): Call __asm__("fscale")
diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h
index 43c4f99..84b3b10 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*);