+2025-04-06 Collin Funk <collin.funk1@gmail.com>
+
+ fseeko: Port to recent Haiku snapshots.
+ * lib/stdio-impl.h (fp_) [__HAIKU__]: Define to FILE which is an
+ incomplete type on Haiku.
+ (_IO_EOF_SEEN) [__HAIKU__]: Define macro.
+ * lib/fseeko.c (fp_) [!__HAIKU__]: Define to fp.
+ (fseeko): Use fp_ instead of fp.
+
2025-04-04 Simon Josefsson <simon@josefsson.org>
maintainer-makefile: Work with modern LCOV versions.
/* These tests are based on fpurge.c. */
#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 (fp->_IO_read_end == fp->_IO_read_ptr
- && fp->_IO_write_ptr == fp->_IO_write_base
- && fp->_IO_save_base == NULL)
+ if (fp_->_IO_read_end == fp_->_IO_read_ptr
+ && fp_->_IO_write_ptr == fp_->_IO_write_base
+ && fp_->_IO_save_base == NULL)
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
# if defined __SL64 && defined __SCLE /* Cygwin */
#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
/* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_flags &= ~_IO_EOF_SEEN;
- fp->_offset = pos;
+ fp_->_flags &= ~_IO_EOF_SEEN;
+ fp_->_offset = pos;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
# if defined __CYGWIN__ || (defined __NetBSD__ && __NetBSD_Version__ >= 600000000) || defined __minix
# endif
#endif
+/* Haiku stdio implementation. */
+#if defined __HAIKU__
+# include <stdint.h>
+/* This FILE structure was made into an incomplete type in 2025.
+ See <https://cgit.haiku-os.org/haiku/tree/src/system/libroot/posix/glibc/libio/libio.h>. */
+# define fp_ ((struct { int _flags; \
+ char *_IO_read_ptr; \
+ char *_IO_read_end; \
+ char *_IO_read_base; \
+ char *_IO_write_base; \
+ char *_IO_write_ptr; \
+ char *_IO_write_end; \
+ char *_IO_buf_base; \
+ char *_IO_buf_end; \
+ char *_IO_save_base; \
+ char *_IO_backup_base; \
+ char *_IO_save_end; \
+ void *_markers; \
+ void *_chain; \
+ int _fileno; \
+ int _flags2; \
+ off_t _old_offset; \
+ unsigned short _cur_column; \
+ signed char _vtable_offset; \
+ char _shortbuf[1]; \
+ void *_lock; \
+ int64_t _offset; \
+ /* More fields, not relevant here. */ \
+ } *) fp)
+# if !defined _IO_EOF_SEEN
+# define _IO_EOF_SEEN 0x10
+# endif
+#endif
+
/* BSD stdio derived implementations. */
#if defined __NetBSD__ /* NetBSD */