]> 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)
committerBruno Haible <bruno@clisp.org>
Mon, 14 Apr 2025 22:53:53 +0000 (00:53 +0200)
* 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 220cdc99ce971c83f3e7e32f5016ab95cf6d54c7..896bdfd800070ab6c540946906234833d5112678 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 ebb915ef8ae7f3e0c99e33b9d248af828da01e4d..db0e6b456b94ebcb57de8ce9b3257ef9aabdd74e 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   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
@@ -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 b813cb9f5bef15a661aab03082e20dc89875c2c1..422492582435dd4d901ff69db9d27571cb348ccb 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.  */