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

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

index d2fe4152476edbf29affc5a37d0aabdb78183de4..289624f4539dbfea15a49b3491a35fccf8296ad7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2025-04-06  Collin Funk  <collin.funk1@gmail.com>
 
+       fbufmode: Port to recent Haiku snapshots.
+       * lib/stdio-impl.h (_IO_UNBUFFERED, _IO_LINE_BUF) [__HAIKU__]: Define
+       macros.
+       * lib/fbufmode.c (fp_) [!__HAIKU__]: Define to fp.
+       (fbufmode): Use fp_ instead of fp.
+
        fseeko: Port to recent Haiku snapshots.
        * lib/stdio-impl.h (fp_) [__HAIKU__]: Define to FILE which is an
        incomplete type on Haiku.
index 57aac732924b8fca0eef26bdbaeaf9d6797cb205..db0e6b456b94ebcb57de8ce9b3257ef9aabdd74e 100644 (file)
@@ -34,15 +34,18 @@ fbufmode (FILE *fp)
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
 #if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+# if !defined __HAIKU__
+#  define fp_ fp
+# endif
   /* GNU libc, BeOS, Haiku, Linux libc5 */
 # if HAVE___FLBF                    /* glibc >= 2.2 */
   if (__flbf (fp))
     return _IOLBF;
 # else
-  if (fp->_flags & _IO_LINE_BUF)
+  if (fp_->_flags & _IO_LINE_BUF)
     return _IOLBF;
 # endif
-  if (fp->_flags & _IO_UNBUFFERED)
+  if (fp_->_flags & _IO_UNBUFFERED)
     return _IONBF;
   return _IOFBF;
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
index b6be0506766d66670d8e2032586b807adb8268df..2e7bf1a7c77ddaa22ee8d85279b2ce510efc94b2 100644 (file)
                          int64_t _offset; \
                          /* More fields, not relevant here.  */ \
                        } *) fp)
+# if !defined _IO_UNBUFFERED
+#  define _IO_UNBUFFERED 0x2
+# endif
 # if !defined _IO_EOF_SEEN
 #  define _IO_EOF_SEEN 0x10
 # endif
+# if !defined _IO_LINE_BUF
+#  define _IO_LINE_BUF 0x200
+# endif
 #endif
 
 /* BSD stdio derived implementations.  */