gnu: python-babel: Update to 2.7.0.
[guix.git] / gnu / packages / patches / oath-toolkit-glibc-compat.patch
blob22814599e54c72c7f311578f25dda1d193166213
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
8 @@ -33,7 +33,7 @@
9 #undef fflush
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). */
16 static void
17 @@ -72,7 +72,7 @@
19 #endif
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 */
26 @@ -148,7 +148,7 @@
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
37 @@ -62,7 +62,7 @@
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
40 fast macros. */
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
48 @@ -31,7 +31,7 @@
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
51 fast macros. */
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
59 @@ -47,7 +47,7 @@
60 #endif
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)
68 @@ -123,7 +123,7 @@
69 return -1;
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;
75 fp->_offset = pos;
76 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
77 --- a/liboath/gl/stdio-impl.h
78 +++ b/liboath/gl/stdio-impl.h
79 @@ -18,6 +18,11 @@
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
86 +#endif
88 /* BSD stdio derived implementations. */
90 #if defined __NetBSD__ /* NetBSD */