1 Subject: Workaround change in glibc
3 Temporary workaround to compile with glibc 2.28, which
4 deprecated some constants
6 Taken from the rpms/m4 Fedora repository, commit 814d5921
7 (Work around change in glibc)
9 Original filename: m4-1.4.18-glibc-change-work-around.patch
11 --- a/lib/stdio-impl.h
12 +++ b/lib/stdio-impl.h
14 the same implementation of stdio extension API, except that some fields
15 have different naming conventions, or their access requires some casts. */
17 +/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
18 + problem by defining it ourselves. FIXME: Do not rely on glibc
20 +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
21 +# define _IO_IN_BACKUP 0x100
24 /* BSD stdio derived implementations. */
32 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
33 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
35 /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
37 @@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
41 -#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
42 +#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
44 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
45 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
46 @@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
47 if (stream == NULL || ! freading (stream))
48 return fflush (stream);
50 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
51 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
53 clear_ungetc_buffer_preserving_position (stream);
57 @@ -32,7 +32,7 @@ __fpending (FILE *fp)
58 /* Most systems provide FILE as a struct and the necessary bitmask in
59 <stdio.h>, because they need it for implementing getc() and putc() as
61 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
62 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
63 return fp->_IO_write_ptr - fp->_IO_write_base;
64 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
65 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
68 @@ -62,7 +62,7 @@ fpurge (FILE *fp)
69 /* Most systems provide FILE as a struct and the necessary bitmask in
70 <stdio.h>, because they need it for implementing getc() and putc() as
72 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
73 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
74 fp->_IO_read_end = fp->_IO_read_ptr;
75 fp->_IO_write_ptr = fp->_IO_write_base;
76 /* Avoid memory leak when there is an active ungetc buffer. */
77 --- a/lib/freadahead.c
78 +++ b/lib/freadahead.c
83 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
84 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
85 if (fp->_IO_write_ptr > fp->_IO_write_base)
87 return (fp->_IO_read_end - fp->_IO_read_ptr)
90 @@ -31,7 +31,7 @@ freading (FILE *fp)
91 /* Most systems provide FILE as a struct and the necessary bitmask in
92 <stdio.h>, because they need it for implementing getc() and putc() as
94 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
95 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
96 return ((fp->_flags & _IO_NO_WRITES) != 0
97 || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
98 && fp->_IO_read_base != NULL));
101 @@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
104 /* These tests are based on fpurge.c. */
105 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
106 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
107 if (fp->_IO_read_end == fp->_IO_read_ptr
108 && fp->_IO_write_ptr == fp->_IO_write_base
109 && fp->_IO_save_base == NULL)
110 @@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
114 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
115 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
116 fp->_flags &= ~_IO_EOF_SEEN;
118 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__