Skip to content

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

Merged
justwheel merged 1 commit into
devshane:masterfrom
Jan200101:PD/curses
Jun 30, 2026
Merged

justwheel merged 1 commit into
devshane: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.

@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
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 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI passes. Merging. 🌊

@justwheel
justwheel merged commit bcf3403 into devshane:master Jun 30, 2026
2 checks passed
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
zork 1.1.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed
* Fix out-of-bounds array access in preposition vocabulary by @fuulish in devshane/zork#22
* Update local.c to include missing header unistd.h by @heademptyshivansh in devshane/zork#25
* 📝 README: Add install instructions, improve history, name maintainers by @justwheel in devshane/zork#35
* fix localtime prototype by @Jan200101 in devshane/zork#30
* add LDFLAGS to Makefile by @Jan200101 in devshane/zork#31
* 👷 ci: Add GitHub Actions build and smoke test pipeline by @justwheel in devshane/zork#38
* 🔧 `.github`: Add issue form template by @justwheel in devshane/zork#42
* add preprocessor to use plain curses header, correct setupterm prototype by @Jan200101 in devshane/zork#32

## New Contributors
* @fuulish made their first contribution in devshane/zork#22
* @heademptyshivansh made their first contribution in devshane/zork#25

**Full Changelog**: https://github.com/devshane/zork/releases/tag/v1.1.0</pre>
  <p>View the full release notes at <a href="https://github.com/devshane/zork/releases/tag/v1.1.0">https://github.com/devshane/zork/releases/tag/v1.1.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!13226
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