From 5e4e1b5253c6772991e0e3e64f1776c4f42d9d48 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Thu, 19 Feb 2026 20:54:13 +0100 Subject: [PATCH] add preprocessor to use plain curses header, correct setupterm prototype The source code was originally designed to be used with X/Open Curses which had a unqiue header to differentiate from all the incompatible curses implementations including the one that was shipped with Ultrix. These days ncurses and PDcurses implement X/Open Curses compatible interfaces so everything is interoperable however on Ultrix curses.h and cursesX.h are two different headers which conflict so a preprocessor is needed to pick the desired header. The setupterm prototype had subtle problems, the return value was always implicitly defined to be int but since it is never used it was set to void and the third argument has always been an int* but this is not an issue at runtime. tested with: `make LIBS=-lcurses TERMFLAG="-DMORE_TERMINFO -DPLAIN_CURSES"` --- supp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/supp.c b/supp.c index ef9a62a..e942d64 100644 --- a/supp.c +++ b/supp.c @@ -116,9 +116,13 @@ extern int tgetnum P((const char *)); #ifdef MORE_TERMINFO +#ifdef PLAIN_CURSES +#include +#else #include +#endif #include -extern void setupterm P((const char *, int, int)); +extern int setupterm P((const char *, int, int *)); #else /* ! MORE_TERMINFO */