Skip to content

Comments

add preprocessor to use plain curses header, correct setupterm prototype#32

Open
Jan200101 wants to merge 1 commit intodevshane:masterfrom
Jan200101:PD/curses
Open

add preprocessor to use plain curses header, correct setupterm prototype#32
Jan200101 wants to merge 1 commit intodevshane:masterfrom
Jan200101:PD/curses

Conversation

@Jan200101
Copy link
Collaborator

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"

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"`
@justwheel justwheel added the bug label Feb 22, 2026
@justwheel justwheel added this to the v1.1.0 milestone Feb 22, 2026
@justwheel
Copy link
Collaborator

@jamesjer Would you be up for doing a peer review on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create git tag/release for Zork v1.1.0

3 participants