gerbera: update to 1.9.1
[feed/packages.git] / devel / m4 / patches / 010-glibc.patch
1 update for glibc libio.h removal in 2.28+
2
3 see
4 https://src.fedoraproject.org/rpms/m4/c/814d592134fad36df757f9a61422d164ea2c6c9b?branch=master
5
6 Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a718]
7 Signed-off-by: Khem Raj <raj.khem@gmail.com>
8
9 --- a/lib/fflush.c
10 +++ b/lib/fflush.c
11 @@ -33,7 +33,7 @@
12 #undef fflush
13
14
15 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
16 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
17
18 /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
19 static void
20 @@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
21
22 #endif
23
24 -#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
25 +#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
26
27 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
28 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
29 @@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
30 if (stream == NULL || ! freading (stream))
31 return fflush (stream);
32
33 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
34 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
35
36 clear_ungetc_buffer_preserving_position (stream);
37
38 --- a/lib/fpending.c
39 +++ b/lib/fpending.c
40 @@ -32,7 +32,7 @@ __fpending (FILE *fp)
41 /* Most systems provide FILE as a struct and the necessary bitmask in
42 <stdio.h>, because they need it for implementing getc() and putc() as
43 fast macros. */
44 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
45 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
46 return fp->_IO_write_ptr - fp->_IO_write_base;
47 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
48 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
49 --- a/lib/fpurge.c
50 +++ b/lib/fpurge.c
51 @@ -62,7 +62,7 @@ fpurge (FILE *fp)
52 /* Most systems provide FILE as a struct and the necessary bitmask in
53 <stdio.h>, because they need it for implementing getc() and putc() as
54 fast macros. */
55 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
56 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
57 fp->_IO_read_end = fp->_IO_read_ptr;
58 fp->_IO_write_ptr = fp->_IO_write_base;
59 /* Avoid memory leak when there is an active ungetc buffer. */
60 --- a/lib/freadahead.c
61 +++ b/lib/freadahead.c
62 @@ -25,7 +25,7 @@
63 size_t
64 freadahead (FILE *fp)
65 {
66 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
67 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
68 if (fp->_IO_write_ptr > fp->_IO_write_base)
69 return 0;
70 return (fp->_IO_read_end - fp->_IO_read_ptr)
71 --- a/lib/freading.c
72 +++ b/lib/freading.c
73 @@ -31,7 +31,7 @@ freading (FILE *fp)
74 /* Most systems provide FILE as a struct and the necessary bitmask in
75 <stdio.h>, because they need it for implementing getc() and putc() as
76 fast macros. */
77 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
78 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
79 return ((fp->_flags & _IO_NO_WRITES) != 0
80 || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
81 && fp->_IO_read_base != NULL));
82 --- a/lib/fseeko.c
83 +++ b/lib/fseeko.c
84 @@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
85 #endif
86
87 /* These tests are based on fpurge.c. */
88 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
89 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
90 if (fp->_IO_read_end == fp->_IO_read_ptr
91 && fp->_IO_write_ptr == fp->_IO_write_base
92 && fp->_IO_save_base == NULL)
93 @@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
94 return -1;
95 }
96
97 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
98 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
99 fp->_flags &= ~_IO_EOF_SEEN;
100 fp->_offset = pos;
101 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
102 --- a/lib/stdio-impl.h
103 +++ b/lib/stdio-impl.h
104 @@ -18,6 +18,12 @@
105 the same implementation of stdio extension API, except that some fields
106 have different naming conventions, or their access requires some casts. */
107
108 +/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
109 + problem by defining it ourselves. FIXME: Do not rely on glibc
110 + internals. */
111 +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
112 +# define _IO_IN_BACKUP 0x100
113 +#endif
114
115 /* BSD stdio derived implementations. */
116