summaryrefslogtreecommitdiff
path: root/lib/stdio-impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdio-impl.h')
-rw-r--r--lib/stdio-impl.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 878e9f8c97d..4b4263fe908 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -30,6 +30,49 @@
# 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_UNBUFFERED
+# define _IO_UNBUFFERED 0x2
+# endif
+# 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
+#endif
+
/* BSD stdio derived implementations. */
#if defined __NetBSD__ /* NetBSD */