2025-04-06 Collin Funk <collin.funk1@gmail.com>
+ fflush: Port to recent Haiku snapshots.
+ * lib/stdio-impl.h (_IO_IN_BACKUP) [__HAIKU__]: Define macros.
+ * lib/fflush.c (fp_) [!__HAIKU__]: Define to fp.
+ (fflush): Use fp_ instead of fp.
+
fbufmode: Port to recent Haiku snapshots.
* lib/stdio-impl.h (_IO_UNBUFFERED, _IO_LINE_BUF) [__HAIKU__]: Define
macros.
/* 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
#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);
}
# if !defined _IO_EOF_SEEN
# define _IO_EOF_SEEN 0x10
# endif
+# if !defined _IO_IN_BACKUP
+# define _IO_IN_BACKUP 0x100
+# endif
# if !defined _IO_LINE_BUF
# define _IO_LINE_BUF 0x200
# endif