1 Subject: Workaround change in glibc
3 Temporary workaround to compile with glibc 2.28, which
4 deprecated some constants
6 Based on the workaround made for the tools/m4 package
8 --- a/gl/lib/stdio-impl.h
9 +++ b/gl/lib/stdio-impl.h
11 the same implementation of stdio extension API, except that some fields
12 have different naming conventions, or their access requires some casts. */
14 +/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
15 + problem by defining it ourselves. FIXME: Do not rely on glibc
17 +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
18 +# define _IO_IN_BACKUP 0x100
21 /* BSD stdio derived implementations. */
23 --- a/gl/lib/freadahead.c
24 +++ b/gl/lib/freadahead.c
29 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
30 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
31 if (fp->_IO_write_ptr > fp->_IO_write_base)
33 return (fp->_IO_read_end - fp->_IO_read_ptr)
36 @@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
39 /* These tests are based on fpurge.c. */
40 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
41 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
42 if (fp->_IO_read_end == fp->_IO_read_ptr
43 && fp->_IO_write_ptr == fp->_IO_write_base
44 && fp->_IO_save_base == NULL)
45 @@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
49 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
50 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
51 fp->_flags &= ~_IO_EOF_SEEN;
53 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
60 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
61 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
63 /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
65 @@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
69 -#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
70 +#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
72 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
73 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
74 @@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
75 if (stream == NULL || ! freading (stream))
76 return fflush (stream);
78 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
79 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
81 clear_ungetc_buffer_preserving_position (stream);
83 --- a/gl/lib/freading.c
84 +++ b/gl/lib/freading.c
85 @@ -31,7 +31,7 @@ freading (FILE *fp)
86 /* Most systems provide FILE as a struct and the necessary bitmask in
87 <stdio.h>, because they need it for implementing getc() and putc() as
89 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
90 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
91 return ((fp->_flags & _IO_NO_WRITES) != 0
92 || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
93 && fp->_IO_read_base != NULL));
96 @@ -62,7 +62,7 @@ fpurge (FILE *fp)
97 /* Most systems provide FILE as a struct and the necessary bitmask in
98 <stdio.h>, because they need it for implementing getc() and putc() as
100 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
101 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
102 fp->_IO_read_end = fp->_IO_read_ptr;
103 fp->_IO_write_ptr = fp->_IO_write_base;
104 /* Avoid memory leak when there is an active ungetc buffer. */