another follow-up for curses_putmixed
We received a report from someone whose build was failing because
of the use of cchar_t and setcchar(). They were getting errors
even though they were using an up-to-date curses library.
Apparently, ncurses requires that _XOPEN_SOURCE_EXTENDED must be
defined before the curses header files in order for those features
to be available.
We had already updated our .370 series of hints and hints/include
files with
-D_XOPEN_SOURCE_EXTENDED=1
but this person must have been building in some other way.
Instead of failing to build in that situation, allow the
fallback to the older, less-functional genl_putmixed() function,
but also try not to do so silently and display a message that
functionality is reduced.
The difference between the use of genl_putmixed() and
curses_putmixed() or tty_putmixed(), is that when doing
'/' farlook operations, curses_putmixed() and tty_putmixed() try to
display a character in the message window that looks exactly the same
as the one on the map, even if a symbol from a symset is being used
on the map, or when using ENHANCED_SYMBOLS.
Related note: curses_putmixed() matches the symbol and the color,
whereas tty_putmixed() (at present) does not attempt to match the
color.
This commit is contained in:
@@ -362,6 +362,8 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
|
||||
#endif
|
||||
#if __GNUC__ >= 5
|
||||
#define NONNULL __attribute__((returns_nonnull))
|
||||
/* #pragma message is available */
|
||||
#define NH_PRAGMA_MESSAGE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -369,6 +371,8 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
|
||||
#ifndef ATTRNORETURN
|
||||
#define ATTRNORETURN __declspec(noreturn)
|
||||
#endif
|
||||
/* #pragma message is available */
|
||||
#define NH_PRAGMA_MESSAGE 1
|
||||
#endif
|
||||
|
||||
#ifndef PRINTF_F
|
||||
|
||||
@@ -24,11 +24,16 @@ extern long curs_mesg_suppress_seq; /* from cursmesg.c */
|
||||
extern boolean curs_mesg_no_suppress; /* ditto */
|
||||
extern int mesg_mixed;
|
||||
extern glyph_info mesg_gi;
|
||||
|
||||
#ifndef CURSES_GENL_PUTMIXED
|
||||
#if !defined(PDCURSES) || defined(PDC_WIDE)
|
||||
#if defined(PDC_WIDE) || defined(NCURSES_WIDECHAR)
|
||||
#define USE_CURSES_PUTMIXED
|
||||
#else /* WIDE */
|
||||
#ifdef NH_PRAGMA_MESSAGE
|
||||
#pragma message "Curses wide support not defined so NetHack curses message window functionality reduced"
|
||||
#endif
|
||||
#endif
|
||||
#endif /* WIDE */
|
||||
#endif /* CURSES_GENL_PUTMIXED */
|
||||
|
||||
/* stubs for curses_procs{} */
|
||||
#ifdef POSITIONBAR
|
||||
|
||||
@@ -31,11 +31,14 @@ int mesg_mixed = 0;
|
||||
glyph_info mesg_gi;
|
||||
|
||||
#ifndef CURSES_GENL_PUTMIXED
|
||||
#if !defined(PDCURSES) || defined(PDC_WIDE)
|
||||
#if defined(PDC_WIDE) || defined(NCURSES_WIDECHAR)
|
||||
#define USE_CURSES_PUTMIXED
|
||||
#else /* WIDE */
|
||||
#ifdef NH_PRAGMA_MESSAGE
|
||||
#pragma message "Curses wide support not defined so NetHack curses message window functionality reduced"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* WIDE */
|
||||
#endif /* CURSES_GENL_PUTMIXED */
|
||||
|
||||
/* Message window routines for curses interface */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user