Collin Funk wrote: > A bit ago, I noticed that Haiku failed to build to to privatizing of > libio.h [1]. Much of this was fixed since Haiku added since they added > stdio_ext.h. > > However, there was still some breakage for fseeko: > > $ cat ../output.txt > fseeko.c: In function 'rpl_fseeko': > fseeko.c:111:4: error: #error "Please port gnulib fseeko.c to your > platform! Look at the code in fseeko.c, then report this to bug-gnulib." > 111 | #error "Please port gnulib fseeko.c to your platform! Look at > the code in fseeko.c, then report this to bug-gnulib." > | ^~~~~ > Makefile:12117: recipe for target 'fseeko.o' failed > make[4]: *** [fseeko.o] Error 1 > > Finally, I have decided to stop being lazy and fixed it with the first > attached patch. > > I ran into similar issues for fbufmode, a Gnulib function, and fflush > which requires fixes on Haiku. Fixed with the second and third attached > patch. > > Lastly, although Haiku added __fseterr recently, it is missing a > declaration. The fourth patch fixes that, and I have updated my original > bug report there [2].
Thanks a lot for this. Let me update some comments accordingly. 2025-04-07 Bruno Haible <br...@clisp.org> stdioext: Update comments regarding Haiku. * lib/fbufmode.c (fbufmode): Update comment. * lib/fpending.c: Likewise. * lib/freadable.c: Likewise. * lib/freadahead.c: Likewise. * lib/freadptr.c: Likewise. * lib/freadseek.c (freadptrinc): Likewise. * lib/fseterr.c: Likewise. * lib/fwritable.c: Likewise. * lib/fwriting.c: Likewise. diff --git a/lib/fbufmode.c b/lib/fbufmode.c index db0e6b456b..440f019ed1 100644 --- a/lib/fbufmode.c +++ b/lib/fbufmode.c @@ -38,7 +38,7 @@ fbufmode (FILE *fp) # define fp_ fp # endif /* GNU libc, BeOS, Haiku, Linux libc5 */ -# if HAVE___FLBF /* glibc >= 2.2 */ +# if HAVE___FLBF /* glibc >= 2.2, Haiku >= hrev58760 */ if (__flbf (fp)) return _IOLBF; # else diff --git a/lib/fpending.c b/lib/fpending.c index 7614b60783..be8a987734 100644 --- a/lib/fpending.c +++ b/lib/fpending.c @@ -26,7 +26,7 @@ /* This file is not used on systems that already have the __fpending function, namely glibc >= 2.2, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34, - Android API >= 23. */ + Android API >= 23, musl libc, Haiku >= hrev58760. */ /* Return the number of pending (aka buffered, unflushed) bytes on the stream, FP, that is open for writing. */ diff --git a/lib/freadable.c b/lib/freadable.c index 1366681dbf..2a494ae1ce 100644 --- a/lib/freadable.c +++ b/lib/freadable.c @@ -27,7 +27,7 @@ /* This file is not used on systems that have the __freadable function, namely glibc >= 2.2, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34, - Android API >= 23, musl libc. */ + Android API >= 23, musl libc, Haiku >= hrev58760. */ bool freadable (FILE *fp) diff --git a/lib/freadahead.c b/lib/freadahead.c index 83258f2f39..5a7da7c30b 100644 --- a/lib/freadahead.c +++ b/lib/freadahead.c @@ -28,7 +28,7 @@ extern size_t __sreadahead (FILE *); #endif /* This file is not used on systems that have the __freadahead function, - namely musl libc. */ + namely musl libc, Haiku >= hrev58760. */ size_t freadahead (FILE *fp) diff --git a/lib/freadptr.c b/lib/freadptr.c index 1c285c2e6d..bb56b47039 100644 --- a/lib/freadptr.c +++ b/lib/freadptr.c @@ -24,7 +24,7 @@ #include "stdio-impl.h" /* This file is not used on systems that have the __freadptr function, - namely musl libc. */ + namely musl libc, Haiku >= hrev58760. */ const char * freadptr (FILE *fp, size_t *sizep) diff --git a/lib/freadseek.c b/lib/freadseek.c index 582400cbb6..1fcc8d255a 100644 --- a/lib/freadseek.c +++ b/lib/freadseek.c @@ -34,10 +34,10 @@ static void freadptrinc (FILE *fp, size_t increment) { /* Keep this code in sync with freadptr! */ -#if HAVE___FREADPTRINC /* musl libc */ +#if HAVE___FREADPTRINC /* musl libc, Haiku >= hrev58760 */ __freadptrinc (fp, increment); #elif defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 - /* GNU libc, BeOS, Haiku, Linux libc5 */ + /* GNU libc, BeOS, Haiku < hrev58760, Linux libc5 */ fp->_IO_read_ptr += increment; #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ diff --git a/lib/fseterr.c b/lib/fseterr.c index a1279a553a..f66f30460a 100644 --- a/lib/fseterr.c +++ b/lib/fseterr.c @@ -24,7 +24,7 @@ #include "stdio-impl.h" /* This file is not used on systems that have the __fseterr function, - namely musl libc. */ + namely musl libc, Haiku >= hrev58760. */ void fseterr (FILE *fp) diff --git a/lib/fwritable.c b/lib/fwritable.c index 4f512ec071..1f29f7f773 100644 --- a/lib/fwritable.c +++ b/lib/fwritable.c @@ -27,7 +27,7 @@ /* This file is not used on systems that have the __fwritable function, namely glibc >= 2.2, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34, - Android API >= 23, musl libc. */ + Android API >= 23, musl libc, Haiku >= hrev58760. */ bool fwritable (FILE *fp) diff --git a/lib/fwriting.c b/lib/fwriting.c index 252c28a2de..3308ffcc3c 100644 --- a/lib/fwriting.c +++ b/lib/fwriting.c @@ -23,7 +23,7 @@ /* This file is not used on systems that have the __fwriting function, namely glibc >= 2.2, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34, - Android API >= 29, musl libc. */ + Android API >= 29, musl libc, Haiku >= hrev58760. */ bool fwriting (FILE *fp)