X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffreadseek.c;h=5301794b4f16dd48168172696463c9789bcc9aed;hb=cd56634a4a8179fd5a4419fbb3e27211b042ab1c;hp=99af4370a1cd76b34f936525ff1e9624b6ea4462;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/lib/freadseek.c b/lib/freadseek.c index 99af4370a..5301794b4 100644 --- a/lib/freadseek.c +++ b/lib/freadseek.c @@ -1,5 +1,5 @@ /* Skipping input from a FILE stream. - Copyright (C) 2007-2010 Free Software Foundation, Inc. + Copyright (C) 2007-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,19 +30,24 @@ /* Increment the in-memory pointer. INCREMENT must be at most the buffer size returned by freadptr(). This is very cheap (no system calls). */ -static inline void +static void freadptrinc (FILE *fp, size_t increment) { /* Keep this code in sync with freadptr! */ -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if HAVE___FREADPTRINC /* musl libc */ + __freadptrinc (fp, increment); +#elif defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_IO_read_ptr += increment; -#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */ fp_->_p += increment; fp_->_r -= increment; #elif defined __EMX__ /* emx+gcc */ fp->_ptr += increment; fp->_rcount -= increment; -#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ +#elif defined __minix /* Minix */ + fp_->_ptr += increment; + fp_->_count -= increment; +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */ fp_->_ptr += increment; fp_->_cnt -= increment; #elif defined __UCLIBC__ /* uClibc */ @@ -55,6 +60,8 @@ freadptrinc (FILE *fp, size_t increment) fp->_Next += increment; #elif defined __MINT__ /* Atari FreeMiNT */ fp->__bufp += increment; +#elif defined EPLAN9 /* Plan9 */ + fp->rp += increment; #elif defined SLOW_BUT_NO_HACKS /* users can define this */ #else #error "Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib."