m4: fix building with glibc2.28

This commit is contained in:
stenstorp 2018-09-19 14:13:58 +09:30 committed by Leah Neukirchen
parent 1bdffd6121
commit 6fb00c9095
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- lib/freadahead.c
+++ lib/freadahead.c
@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
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)

View File

@ -0,0 +1,14 @@
--- lib/stdio-impl.h
+++ lib/stdio-impl.h
@@ -18,6 +18,12 @@
the same implementation of stdio extension API, except that some fields
have different naming conventions, or their access requires some casts. */
+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
+ problem by defining it ourselves. FIXME: Do not rely on glibc
+ internals. */
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
+# define _IO_IN_BACKUP 0x100
+#endif
/* BSD stdio derived implementations. */