]> Savannah Git Hosting - gnulib.git/commitdiff
fflush: Port to recent Haiku snapshots.
authorCollin Funk <collin.funk1@gmail.com>
Mon, 7 Apr 2025 02:34:54 +0000 (19:34 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Mon, 7 Apr 2025 02:34:54 +0000 (19:34 -0700)
* lib/stdio-impl.h (_IO_IN_BACKUP) [__HAIKU__]: Define macros.
* lib/fflush.c (fp_) [!__HAIKU__]: Define to fp.
(fflush): Use fp_ instead of fp.

ChangeLog
lib/fflush.c
lib/stdio-impl.h

index 289624f4539dbfea15a49b3491a35fccf8296ad7..d1a16e15da9a01082c0fc801008ffa22072b41a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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.
index 85af768ce710aad8ef09156c27de821e49f48f10..9e256f327229098f506a8d73e2bbe8a258d66f62 100644 (file)
 
 #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);
 }
index 2e7bf1a7c77ddaa22ee8d85279b2ce510efc94b2..4b4263fe9087a215904158746abff13099241449 100644 (file)
@@ -65,6 +65,9 @@
 # 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