]> 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)
committerBruno Haible <bruno@clisp.org>
Mon, 14 Apr 2025 22:54:21 +0000 (00:54 +0200)
* 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 896bdfd800070ab6c540946906234833d5112678..11ef1a3b82c78621df458fb0fbfc99cad6f2087c 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 36cc14d1f68e6385185e86a758e34cea2788e117..9e256f327229098f506a8d73e2bbe8a258d66f62 100644 (file)
@@ -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
 
 #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 422492582435dd4d901ff69db9d27571cb348ccb..ec79fa7164a86958a30dae166a3bf0e5b42bbfc8 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