From b0afb8fe0ff1d87165af9df61501197a06240dda Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 28 Dec 2025 12:13:40 +0100 Subject: Sync with Gnulib stable-202507 code (a8ac9f9ce5) --- gl/fflush.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'gl/fflush.c') diff --git a/gl/fflush.c b/gl/fflush.c index 36cc14d1..d8619082 100644 --- a/gl/fflush.c +++ b/gl/fflush.c @@ -1,5 +1,5 @@ /* fflush.c -- allow flushing input streams - Copyright (C) 2007-2024 Free Software Foundation, Inc. + Copyright (C) 2007-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -33,12 +33,15 @@ #if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ +# if !defined __HAIKU__ +# define fp_ fp +# endif /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ static void clear_ungetc_buffer_preserving_position (FILE *fp) { - if (fp->_flags & _IO_IN_BACKUP) + if (fp_->_flags & _IO_IN_BACKUP) /* _IO_free_backup_area is a bit complicated. Simply call fseek. */ fseeko (fp, 0, SEEK_CUR); } @@ -50,7 +53,7 @@ static void clear_ungetc_buffer (FILE *fp) { # if defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD <= 7.7, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ if (HASUB (fp)) { fp_->_p += fp_->_r; @@ -75,7 +78,7 @@ clear_ungetc_buffer (FILE *fp) /* GNU libc, BeOS, Haiku, Linux libc5 */ # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT -/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ +/* FreeBSD, NetBSD, OpenBSD <= 7.7, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ static int disable_seek_optimization (FILE *fp) @@ -98,7 +101,7 @@ update_fpos_cache (_GL_ATTRIBUTE_MAYBE_UNUSED FILE *fp, _GL_ATTRIBUTE_MAYBE_UNUSED off_t pos) { # if defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD <= 7.7, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ # if defined __CYGWIN__ || defined __ANDROID__ /* fp_->_offset is typed as an integer. */ fp_->_offset = pos; @@ -203,7 +206,7 @@ rpl_fflush (FILE *stream) } # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD <= 7.7, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ { /* Disable seek optimization for the next fseeko call. This tells the -- cgit v1.2.3-74-g34f1