curses: the vendored fpurge only where the libc has none

NetBSD declares fpurge() in <stdio.h>, so a static definition in the vendored
libcurses contradicts the prototype and -Werror stops the cross build
(static declaration of 'fpurge' follows non-static declaration,
build/logs/release-2026-11-23h-cross.log:21830).  FreeBSD was the only libc
the guard knew about; the four BSDs and macOS all carry the call.

Test: x86_64--netbsd-gcc -std=gnu11 -I. -I./libterminfo -I build/obj/destdir.amd64/usr/include -c libcurses/tty.c -> rc=0, no errors.
This commit is contained in:
lotherk committed 2026-11-23 12:35:14 +00:00
1 parent f7c374bcbb
commit d0a3c484ef
1 file changed
+8 -1
+8 -1
View File
@@ -592,7 +592,14 @@ isendwin(void)
return _cursesi_screen->endwin ? TRUE : FALSE;
}
#ifndef __FreeBSD__
/* NetBSD declares fpurge() in <stdio.h> (and so does every libc that kept
* the 4.4BSD call): a static definition here then contradicts the prototype
* -- "static declaration of 'fpurge' follows non-static declaration", which
* stopped the cross build (build/logs/release-2026-11-23h-cross.log:21830).
* The vendored copy is only for systems that have neither, __FreeBSD__ was
* the first of them. */
#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && \
!defined(__DragonFly__) && !defined(__OpenBSD__)
static int fpurge(FILE *f) {
//dprintf(666, "warning: called fpurge\n");
fflush(f);