Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly report which version of libncurses was linked #1241

Merged
merged 1 commit into from
Nov 20, 2022

Conversation

mqudsi
Copy link
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
@@ -557,7 +557,7 @@ parse_options(int argc, const char *argv[], bool pager_mode)
printf("tig version %s\n", TIG_VERSION);
#ifdef NCURSES_VERSION
printf("%s version %s.%d\n",
#ifdef NCURSES_WIDECHAR
#ifdef HAVE_NCURSESW_CURSES_H
Copy link
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
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
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