diff --git a/lib/freadahead.c b/lib/freadahead.c index 01b0810..f1b6d3e 100644 --- a/lib/freadahead.c +++ b/lib/freadahead.c @@ -22,10 +22,14 @@ #include #include "stdio-impl.h" +#ifndef _IO_IN_BACKUP +#define _IO_IN_BACKUP 0x0100 +#endif + size_t freadahead (FILE *fp) { -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ if (fp->_IO_write_ptr > fp->_IO_write_base) return 0; return (fp->_IO_read_end - fp->_IO_read_ptr) diff --git a/lib/freadptr.c b/lib/freadptr.c index 26c66ed..5051843 100644 --- a/lib/freadptr.c +++ b/lib/freadptr.c @@ -29,7 +29,7 @@ freadptr (FILE *fp, size_t *sizep) size_t size; /* Keep this code in sync with freadahead! */ -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ if (fp->_IO_write_ptr > fp->_IO_write_base) return NULL; size = fp->_IO_read_end - fp->_IO_read_ptr; diff --git a/lib/freadseek.c b/lib/freadseek.c index 5301794..a423913 100644 --- a/lib/freadseek.c +++ b/lib/freadseek.c @@ -26,6 +26,9 @@ #include "freadptr.h" #include "stdio-impl.h" +#ifndef _IO_IN_BACKUP +#define _IO_IN_BACKUP 0x0100 +#endif /* Increment the in-memory pointer. INCREMENT must be at most the buffer size returned by freadptr(). @@ -36,7 +39,7 @@ freadptrinc (FILE *fp, size_t increment) /* Keep this code in sync with freadptr! */ #if HAVE___FREADPTRINC /* musl libc */ __freadptrinc (fp, increment); -#elif defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#elif defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_IO_read_ptr += increment; #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */ fp_->_p += increment; diff --git a/lib/fseterr.c b/lib/fseterr.c index 1e212e4..913ed88 100644 --- a/lib/fseterr.c +++ b/lib/fseterr.c @@ -29,7 +29,7 @@ fseterr (FILE *fp) /* Most systems provide FILE as a struct and the necessary bitmask in , because they need it for implementing getc() and putc() as fast macros. */ -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_ERR_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_flags |= _IO_ERR_SEEN; #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */ fp_->_flags |= __SERR;