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.
<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__
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. */