Skip to content

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
Copy Markdown
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"

@justwheel justwheel added the bug Something is broken or produces incorrect behavior label Feb 22, 2026
@justwheel justwheel added this to the v1.1.0 milestone Feb 22, 2026
@justwheel
Copy link
Copy Markdown
Collaborator

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

@justwheel
Copy link
Copy Markdown
Collaborator

I rebased the PR on the latest changes in master branch after #30 merged. I am keeping this PR open a bit longer to invite any final review here. @jamesjer, did you still want to help out with the code review?

@justwheel
Copy link
Copy Markdown
Collaborator

I want to merge #38 ahead of this PR. Then, after merging, this PR can be rebased on master and we can more deterministically use the CI pipeline to assess future Pull Requests to ensure that both GCC and Clang successfully compile Zork.

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 linked an issue Apr 20, 2026 that may be closed by this pull request
@justwheel justwheel added the build system Makefile, compiler flags, linker settings, install targets label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken or produces incorrect behavior build system Makefile, compiler flags, linker settings, install targets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create git tag/release for Zork v1.1.0

3 participants