2009-02-28 Bruno Haible <bruno@clisp.org>
- * tests/test-freadseek.c (main): Disable test beyond end of file on FreeMiNT.
+ More support for FreeMiNT.
+ * lib/freading.c (freading) [__MINT__]: Use new macros that were added
+ to FreeMiNT today.
+ * lib/fwriting.c (fwriting): Likewise.
+ Based on patch by Alan Hourihane <alanh@fairlite.co.uk>.
+
+2009-02-28 Bruno Haible <bruno@clisp.org>
+
+ * tests/test-freadseek.c (main): Disable test beyond end of file on
+ FreeMiNT.
* tests/test-ftello.c (main): Likewise.
Patch by Alan Hourihane <alanh@fairlite.co.uk>.
return ((fp->_Mode & 0x2 /* _MOPENW */) == 0
|| (fp->_Mode & 0x1000 /* _MREAD */) != 0);
#elif defined __MINT__ /* Atari FreeMiNT */
- return (!fp->__mode.__write
- || (fp->__mode.__read
- && (fp->__buffer < fp->__get_limit
- /*|| fp->__bufp == fp->__put_limit ??*/)));
+ if (!fp->__mode.__write)
+ return 1;
+ if (!fp->__mode.__read)
+ return 0;
+# ifdef _IO_CURRENTLY_GETTING /* Flag added on 2009-02-28 */
+ return (fp->__flags & _IO_CURRENTLY_GETTING) != 0;
+# else
+ return (fp->__buffer < fp->__get_limit /*|| fp->__bufp == fp->__put_limit ??*/);
+# endif
#else
#error "Please port gnulib freading.c to your platform!"
#endif
return ((fp->_Mode & 0x1 /* _MOPENR */) == 0
|| (fp->_Mode & 0x2000 /* _MWRITE */) != 0);
#elif defined __MINT__ /* Atari FreeMiNT */
- return (!fp->__mode.__read
- || (fp->__mode.__write
- && (fp->__buffer < fp->__put_limit
- /*|| fp->__bufp == fp->__get_limit ??*/)));
+ if (!fp->__mode.__read)
+ return 1;
+ if (!fp->__mode.__write)
+ return 0;
+# ifdef _IO_CURRENTLY_PUTTING /* Flag added on 2009-02-28 */
+ return (fp->__flags & _IO_CURRENTLY_PUTTING) != 0;
+# else
+ return (fp->__buffer < fp->__put_limit /*|| fp->__bufp == fp->__get_limit ??*/);
+# endif
#else
#error "Please port gnulib fwriting.c to your platform!"
#endif