Mercurial > hg > octave-lyh > gnulib-hg
changeset 9456:b3c8ee11ddfa
Fix port to QNX.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Wed, 07 Nov 2007 01:36:49 +0100 |
parents | a964cf6866e7 |
children | 5671e991175c |
files | ChangeLog lib/fbufmode.c lib/fpurge.c lib/freadable.c lib/freadahead.c lib/freading.c lib/fseterr.c lib/fwritable.c lib/fwriting.c |
diffstat | 9 files changed, 23 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2007-11-06 Bruno Haible <bruno@clisp.org> + * lib/fbufmode.c (fbufmode) [QNX]: Use numerical values for flags; the + symbolic values are not defined in a public header. + * lib/freadable.c (freadable) [QNX]: Likewise. + * lib/freadahead.c (freadahead) [QNX]: Likewise. + * lib/freading.c (freading) [QNX]: Likewise. + * lib/fseterr.c (fseterr) [QNX]: Likewise. + * lib/fwritable.c (fwritable) [QNX]: Likewise. + * lib/fwriting.c (fwriting) [QNX]: Likewise. + * lib/fpurge.c (fpurge) [QNX]: Likewise. Add a return statement. + Reported by Alain Magloire. + * m4/fpending.m4 (gl_FUNC_FPENDING): Add a variant for QNX. 2007-11-05 Bruno Haible <bruno@clisp.org>
--- a/lib/fbufmode.c +++ b/lib/fbufmode.c @@ -75,9 +75,9 @@ return _IONBF; return _IOFBF; #elif defined __QNX__ /* QNX */ - if (fp->_Mode & _MLBF) + if (fp->_Mode & 0x400 /* _MLBF */) return _IOLBF; - if (fp->_Mode & _MNBF) + if (fp->_Mode & 0x800 /* _MNBF */) return _IONBF; return _IOFBF; #else
--- a/lib/fpurge.c +++ b/lib/fpurge.c @@ -106,12 +106,13 @@ # elif defined __QNX__ /* QNX */ fp->_Rback = fp->_Back + sizeof (fp->_Back); fp->_Rsave = NULL; - if (fp->_Mode & _MWRITE) + if (fp->_Mode & 0x2000 /* _MWRITE */) /* fp->_Buf <= fp->_Next <= fp->_Wend */ fp->_Next = fp->_Buf; else /* fp->_Buf <= fp->_Next <= fp->_Rend */ fp->_Rend = fp->_Next; + return 0; # else #error "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib." # endif
--- a/lib/freadable.c +++ b/lib/freadable.c @@ -32,7 +32,7 @@ #elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */ return (fp->_flag & (_IORW | _IOREAD)) != 0; #elif defined __QNX__ /* QNX */ - return (fp->_Mode & _MOPENR) != 0; + return (fp->_Mode & 0x1 /* _MOPENR */) != 0; #else #error "Please port gnulib freadable.c to your platform! Look at the definition of fopen, fdopen on your system, then report this to bug-gnulib." #endif
--- a/lib/freadahead.c +++ b/lib/freadahead.c @@ -56,7 +56,7 @@ return 0; # endif #elif defined __QNX__ /* QNX */ - if ((fp->_Mode & _MWRITE) != 0) + if ((fp->_Mode & 0x2000 /* _MWRITE */) != 0) return 0; /* fp->_Buf <= fp->_Next <= fp->_Rend */ return fp->_Rend - fp->_Next;
--- a/lib/freading.c +++ b/lib/freading.c @@ -40,8 +40,8 @@ #elif defined __UCLIBC__ /* uClibc */ return (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) != 0; #elif defined __QNX__ /* QNX */ - return ((fp->_Mode & _MOPENW) == 0 - || (fp->_Mode & _MREAD) != 0); + return ((fp->_Mode & 0x2 /* _MOPENW */) == 0 + || (fp->_Mode & 0x1000 /* _MREAD */) != 0); #else #error "Please port gnulib freading.c to your platform!" #endif
--- a/lib/fseterr.c +++ b/lib/fseterr.c @@ -47,7 +47,7 @@ #elif defined __UCLIBC__ /* uClibc */ fp->__modeflags |= __FLAG_ERROR; #elif defined __QNX__ /* QNX */ - fp->_Mode |= _MERR; + fp->_Mode |= 0x200 /* _MERR */; #elif 0 /* unknown */ /* Portable fallback, based on an idea by Rich Felker. Wow! 6 system calls for something that is just a bit operation!
--- a/lib/fwritable.c +++ b/lib/fwritable.c @@ -32,7 +32,7 @@ #elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */ return (fp->_flag & (_IORW | _IOWRT)) != 0; #elif defined __QNX__ /* QNX */ - return (fp->_mode & _MOPENW) != 0; + return (fp->_Mode & 0x2 /* _MOPENW */) != 0; #else #error "Please port gnulib fwritable.c to your platform! Look at the definition of fopen, fdopen on your system, then report this to bug-gnulib." #endif
--- a/lib/fwriting.c +++ b/lib/fwriting.c @@ -34,8 +34,8 @@ #elif defined __UCLIBC__ /* uClibc */ return (fp->__modeflags & __FLAG_WRITING) != 0; #elif defined __QNX__ /* QNX */ - return ((fp->_Mode & _MOPENR) == 0 - || (fp->_Mode & _MWRITE) != 0); + return ((fp->_Mode & 0x1 /* _MOPENR */) == 0 + || (fp->_Mode & 0x2000 /* _MWRITE */) != 0); #else #error "Please port gnulib fwriting.c to your platform!" #endif