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