On Sun, 2009-03-01 at 02:40 +0100, Bruno Haible wrote: > Alan Hourihane wrote: > > Attached are the freading.c and fwriting.c patches to make them pass. > > Thanks. I've committed it like this:
Thanks, but the #else section is still broken for older mintlibs, and it's really not going to work. That's why I added the new functionality. Alan. > 2009-02-28 Bruno Haible <br...@clisp.org> > > 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 <al...@fairlite.co.uk>. > > --- lib/freading.c.orig 2009-03-01 02:35:56.000000000 +0100 > +++ lib/freading.c 2009-03-01 02:27:09.000000000 +0100 > @@ -47,10 +47,15 @@ > 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 > --- lib/fwriting.c.orig 2009-03-01 02:35:56.000000000 +0100 > +++ lib/fwriting.c 2009-03-01 02:28:40.000000000 +0100 > @@ -41,10 +41,15 @@ > 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