address #H4266 - build problem with clang Modules

Report states that using OSX Xcode IDE results in use of 'clang
Modules', whatever those are, and role.c's 'filter' struct ends up
conflicting with a function declared by <curses.h> (or possibly
<ncurses.h> since one includes the other).  src/role.c does not
include <curses.h>, so this smacks of the problems caused by using
precompiled headers on pre-OSX Mac.

Instead of trying to import nethack into Xcode, I temporarily
inserted '#include <curses.h>' at the end of unixconf.h.  gcc did
complain about 'filter' in role.c (but not in invent.c, despite
-Wshadow), and then complained about termcap.c using TRUE when it
wasn't defined (after in had been #undef'd, where there's a comment
stating that it won't be used in the rest of that file), and also
complained about static function winch() in wintty.c conflicting
with external winch() in curses.

This renames 'filter' and 'winch()' to things that won't conflict.
Also, our winch() is a signal handler but had the wrong signature
for one.  And the troublesome use of TRUE was in code that was
supposed to be dealing with int rather than boolean.
This commit is contained in:
PatR
2016-03-02 00:37:56 -08:00
parent 3c5c4708e0
commit 7a5fb72787
5 changed files with 54 additions and 38 deletions

View File

@@ -182,6 +182,8 @@ tty: specifying all four of role, race, gender, and alignment still prompted
for confirmation with "Is this ok?" before starting play
tty: responding with <return> or <enter> during role, race, &c selection
behaved same as <escape> to quit; now it will pick [random] instead
tty: rename struct variable 'filter' (role.c) and function 'winch()' (wintty.c)
to avoid conflicts with <curses.h>
unix/X11: in top level Makefile, some commented out definitions of VARDATND
misspelled pilemark.xbm (as pilemark.xpm)
unix: options file with CR+LF line ends and an invalid option line resulted in