diff options
author | zhukoff-pavel <zhukoff-pavel@yandex-team.com> | 2023-10-24 16:10:02 +0300 |
---|---|---|
committer | zhukoff-pavel <zhukoff-pavel@yandex-team.com> | 2023-10-24 16:27:45 +0300 |
commit | 6b1378c8c968c4c468bf2494e0ec6d6958dcd100 (patch) | |
tree | fefcd2792c9cc19f1efb3490d127f55f46e72be1 | |
parent | 3106db4aaf3646abdd720fd74b2faf136b7e72e5 (diff) | |
download | ydb-6b1378c8c968c4c468bf2494e0ec6d6958dcd100.tar.gz |
[contrib/tools/bison/gnulib] Patch for newer glibc
-rw-r--r-- | contrib/tools/bison/gnulib/src/fflush.c | 6 | ||||
-rw-r--r-- | contrib/tools/bison/gnulib/src/fpurge.c | 2 | ||||
-rw-r--r-- | contrib/tools/bison/gnulib/src/freadahead.c | 2 | ||||
-rw-r--r-- | contrib/tools/bison/gnulib/src/freading.c | 2 | ||||
-rw-r--r-- | contrib/tools/bison/gnulib/src/fseeko.c | 4 | ||||
-rw-r--r-- | contrib/tools/bison/gnulib/src/fseterr.c | 2 | ||||
-rw-r--r-- | contrib/tools/bison/gnulib/src/stdio-impl.h | 7 |
7 files changed, 16 insertions, 9 deletions
diff --git a/contrib/tools/bison/gnulib/src/fflush.c b/contrib/tools/bison/gnulib/src/fflush.c index 9df79119dd4..c182ac1fa42 100644 --- a/contrib/tools/bison/gnulib/src/fflush.c +++ b/contrib/tools/bison/gnulib/src/fflush.c @@ -33,7 +33,7 @@ #undef fflush -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ static void @@ -71,7 +71,7 @@ clear_ungetc_buffer (FILE *fp) #endif -#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) +#if ! (defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) # if (defined __sferror || defined __DragonFly__) && defined __SNPT /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */ @@ -145,7 +145,7 @@ rpl_fflush (FILE *stream) if (stream == NULL || ! freading (stream)) return fflush (stream); -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ clear_ungetc_buffer_preserving_position (stream); diff --git a/contrib/tools/bison/gnulib/src/fpurge.c b/contrib/tools/bison/gnulib/src/fpurge.c index 6c74355b71e..09c9ea82c74 100644 --- a/contrib/tools/bison/gnulib/src/fpurge.c +++ b/contrib/tools/bison/gnulib/src/fpurge.c @@ -61,7 +61,7 @@ fpurge (FILE *fp) /* Most systems provide FILE as a struct and the necessary bitmask in <stdio.h>, because they need it for implementing getc() and putc() as fast macros. */ -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_IO_read_end = fp->_IO_read_ptr; fp->_IO_write_ptr = fp->_IO_write_base; /* Avoid memory leak when there is an active ungetc buffer. */ diff --git a/contrib/tools/bison/gnulib/src/freadahead.c b/contrib/tools/bison/gnulib/src/freadahead.c index bf53271fd27..ae24e3b8a37 100644 --- a/contrib/tools/bison/gnulib/src/freadahead.c +++ b/contrib/tools/bison/gnulib/src/freadahead.c @@ -25,7 +25,7 @@ size_t freadahead (FILE *fp) { -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ if (fp->_IO_write_ptr > fp->_IO_write_base) return 0; return (fp->_IO_read_end - fp->_IO_read_ptr) diff --git a/contrib/tools/bison/gnulib/src/freading.c b/contrib/tools/bison/gnulib/src/freading.c index 3d7e4e56f08..c2ffd937352 100644 --- a/contrib/tools/bison/gnulib/src/freading.c +++ b/contrib/tools/bison/gnulib/src/freading.c @@ -31,7 +31,7 @@ freading (FILE *fp) /* Most systems provide FILE as a struct and the necessary bitmask in <stdio.h>, because they need it for implementing getc() and putc() as fast macros. */ -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ return ((fp->_flags & _IO_NO_WRITES) != 0 || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 && fp->_IO_read_base != NULL)); diff --git a/contrib/tools/bison/gnulib/src/fseeko.c b/contrib/tools/bison/gnulib/src/fseeko.c index 16404b71ebb..0c326592b9d 100644 --- a/contrib/tools/bison/gnulib/src/fseeko.c +++ b/contrib/tools/bison/gnulib/src/fseeko.c @@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence) #endif /* These tests are based on fpurge.c. */ -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ if (fp->_IO_read_end == fp->_IO_read_ptr && fp->_IO_write_ptr == fp->_IO_write_base && fp->_IO_save_base == NULL) @@ -124,7 +124,7 @@ fseeko (FILE *fp, off_t offset, int whence) return -1; } -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_flags &= ~_IO_EOF_SEEN; fp->_offset = pos; #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */ diff --git a/contrib/tools/bison/gnulib/src/fseterr.c b/contrib/tools/bison/gnulib/src/fseterr.c index 9f7bea13b33..f2191b69237 100644 --- a/contrib/tools/bison/gnulib/src/fseterr.c +++ b/contrib/tools/bison/gnulib/src/fseterr.c @@ -29,7 +29,7 @@ fseterr (FILE *fp) /* Most systems provide FILE as a struct and the necessary bitmask in <stdio.h>, because they need it for implementing getc() and putc() as fast macros. */ -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_flags |= _IO_ERR_SEEN; #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */ fp_->_flags |= __SERR; diff --git a/contrib/tools/bison/gnulib/src/stdio-impl.h b/contrib/tools/bison/gnulib/src/stdio-impl.h index 45291cf3ba0..e510bb8f42d 100644 --- a/contrib/tools/bison/gnulib/src/stdio-impl.h +++ b/contrib/tools/bison/gnulib/src/stdio-impl.h @@ -14,6 +14,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this + problem by defining it ourselves. FIXME: Do not rely on glibc + internals. */ +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN +# define _IO_IN_BACKUP 0x100 +#endif + /* Many stdio implementations have the same logic and therefore can share the same implementation of stdio extension API, except that some fields have different naming conventions, or their access requires some casts. */ |