Skip to content

Correctly report which version of libncurses was linked#1241

Merged
koutcher merged 1 commit intojonas:masterfrom
mqudsi:ncursesw_info
Nov 20, 2022
Merged

Correctly report which version of libncurses was linked#1241
koutcher merged 1 commit intojonas:masterfrom
mqudsi:ncursesw_info

Conversation

@mqudsi
Copy link
Copy Markdown
Contributor

@mqudsi mqudsi commented Oct 20, 2022

Later versions of ncurses (20111030 and up) support NCURSES_WIDECHAR even when compiling with libncurses instead of libncursesw.

Have tig correctly report whether it was linked against libncursesw or libncurses based off the same defines we set in the build script and use to determine which headers to include.

(See #1240 as an example of where tig --version incorrectly reports ncursesw instead of ncurses).

src/tig.c Outdated
#ifdef NCURSES_VERSION
printf("%s version %s.%d\n",
#ifdef NCURSES_WIDECHAR
#ifdef HAVE_NCURSESW_CURSES_H
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.

Thanks for reporting and fixing the problem. To be consistent with ax_with_curses.m4 we probably have to make it #if defined(HAVE_NCURSESW_CURSES_H) || defined(HAVE_NCURSESW_H), don't you think ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe you're correct and I've force-pushed an update that uses both. I'm not sure how I missed that.

Later versions of ncurses (20111030 and up) support NCURSES_WIDECHAR even when
compiling with libncurses instead of libncursesw.

Have tig correctly report whether it was linked against libncursesw or
libncurses based off the same defines we set in the build script and use to
determine which headers to include.

Per the build system, either of HAVE_NCURSESW_H or HAVE_NCURSESW_CURSES_H may
indicate the presence of ncursesw, so both are checked.

(See jonas#1240 as an example of where `tig --version` incorrectly reports `ncursesw`
instead of `ncurses`).
@koutcher koutcher merged commit d5e3fc3 into jonas:master Nov 20, 2022
vxsl pushed a commit to vxsl/tig that referenced this pull request Mar 18, 2026
Later versions of ncurses (20111030 and up) support NCURSES_WIDECHAR even when
compiling with libncurses instead of libncursesw.

Have tig correctly report whether it was linked against libncursesw or
libncurses based off the same defines we set in the build script and use to
determine which headers to include.

Per the build system, either of HAVE_NCURSESW_H or HAVE_NCURSESW_CURSES_H may
indicate the presence of ncursesw, so both are checked.

(See jonas#1240 as an example of where `tig --version` incorrectly reports `ncursesw`
instead of `ncurses`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants