1 Adjust the bundled Gnulib to cope with removal of libio interface in Glibc 2.28.
3 Based on this upstream gnulib patch:
4 https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
6 --- a/liboath/gl/fflush.c
7 +++ b/liboath/gl/fflush.c
12 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
13 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
15 /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
21 -#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
22 +#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
24 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
25 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
27 if (stream == NULL || ! freading (stream))
28 return fflush (stream);
30 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
31 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
33 clear_ungetc_buffer_preserving_position (stream);
35 --- a/liboath/gl/fpurge.c
36 +++ b/liboath/gl/fpurge.c
38 /* Most systems provide FILE as a struct and the necessary bitmask in
39 <stdio.h>, because they need it for implementing getc() and putc() as
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 */
43 fp->_IO_read_end = fp->_IO_read_ptr;
44 fp->_IO_write_ptr = fp->_IO_write_base;
45 /* Avoid memory leak when there is an active ungetc buffer. */
46 --- a/libaoth/gl/freading.c
47 +++ b/liboath/gl/freading.c
49 /* Most systems provide FILE as a struct and the necessary bitmask in
50 <stdio.h>, because they need it for implementing getc() and putc() as
52 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
53 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
54 return ((fp->_flags & _IO_NO_WRITES) != 0
55 || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
56 && fp->_IO_read_base != NULL));
57 --- a/liboath/gl/fseeko.c
58 +++ b/liboath/gl/fseeko.c
62 /* These tests are based on fpurge.c. */
63 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
64 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
65 if (fp->_IO_read_end == fp->_IO_read_ptr
66 && fp->_IO_write_ptr == fp->_IO_write_base
67 && fp->_IO_save_base == NULL)
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->_flags &= ~_IO_EOF_SEEN;
76 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
77 --- a/liboath/gl/stdio-impl.h
78 +++ b/liboath/gl/stdio-impl.h
80 the same implementation of stdio extension API, except that some fields
81 have different naming conventions, or their access requires some casts. */
83 +/* Glibc 2.28 made _IO_IN_BACKUP private, so define it here for now. */
84 +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
85 +# define _IO_IN_BACKUP 0x100
88 /* BSD stdio derived implementations. */
90 #if defined __NetBSD__ /* NetBSD */