diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index e68f07ce6..ec424bfab 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -119,6 +119,11 @@ SYSOBJ = $(TARGETPFX)ioctl.o $(TARGETPFX)unixmain.o $(TARGETPFX)unixtty.o \ # CFLAGS = -mshort -O2 -fomit-frame-pointer -I../include # LFLAGS = -mshort -s +# Curses, use one of the following: +# -D_XOPEN_SOURCE_EXTENDED=1 allows any map character to appear in the message window +# during far look with the '/' command. +# -DCURSES_GENL_PUTMIXED to disable that and fall back to displaying only the historical tty character. +# # flags for AIX 3.1 cc on IBM RS/6000 to define # a suitable subset of standard libraries # (note that there is more info regarding the "-qchars=signed" diff --git a/sys/unix/hints/include/multiw-2.370 b/sys/unix/hints/include/multiw-2.370 index a032300eb..815a20b3a 100644 --- a/sys/unix/hints/include/multiw-2.370 +++ b/sys/unix/hints/include/multiw-2.370 @@ -90,7 +90,12 @@ WINCFLAGS += -DNOTTYGRAPHICS endif ifdef WANT_WIN_CURSES -WINCFLAGS += -DCURSES_GRAPHICS -D_XOPEN_SOURCE_EXTENDED=1 +WINCFLAGS += -DCURSES_GRAPHICS +ifeq "$(NOPUTMIXED)" "1" +WINCFLAGS += -DCURSES_GENL_PUTMIXED +else +WINCFLAGS += -D_XOPEN_SOURCE_EXTENDED=1 +endif WINSRC += $(WINCURSESSRC) WINOBJ0 += $(WINCURSESOBJ) endif diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index 2f802d1a2..66b71cf83 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -72,10 +72,10 @@ struct window_procs curses_procs = { curses_destroy_nhwindow, curses_curs, curses_putstr, -#if !defined(PDCURSES) || defined(PDC_WIDE) - curses_putmixed, -#else +#if defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE)) genl_putmixed, +#else + curses_putmixed, #endif curses_display_file, curses_start_menu, diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index 81a98fdd9..9e3601e9c 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -46,7 +46,9 @@ static void unscroll_window(winid wid); static void directional_scroll(winid wid, int nlines); static void mesg_add_line(const char *mline); static nhprev_mesg *get_msg_line(boolean reverse, int mindex); +#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE)) static int curscolor(int nhcolor, boolean *boldon); +#endif static int turn_lines = 0; static int mx = 0; @@ -66,9 +68,10 @@ curses_message_win_puts(const char *message, boolean recursed) char *tmpstr; WINDOW *win = curses_get_nhwin(MESSAGE_WIN); boolean bold, border = curses_window_has_border(MESSAGE_WIN), - have_mixed_leadin = FALSE, adjustbold = FALSE; + adjustbold = FALSE; int message_length = (int) strlen(message); -#if !defined(PDCURSES) || defined(PDC_WIDE) +#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE)) + boolean have_mixed_leadin = FALSE; cchar_t mixed_leadin_cchar[2]; #endif @@ -120,7 +123,7 @@ curses_message_win_puts(const char *message, boolean recursed) linespace -= 2; bold = (height > 1 && !last_messages); -#if !defined(PDCURSES) || defined(PDC_WIDE) +#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE)) if (mesg_mixed) { wchar_t w[2]; int leadin_color; @@ -149,7 +152,7 @@ curses_message_win_puts(const char *message, boolean recursed) message_length++; /* account for that additional column */ } } -#endif /* !PDCURSES || PDC_WIDE */ +#endif /* CURSES_GENL_PUTMIXED || PDCURSES without PDC_WIDE */ if (linespace < message_length) { if (my - border_space >= height - 1) { @@ -190,7 +193,7 @@ curses_message_win_puts(const char *message, boolean recursed) if (mx == border_space && message_length > width - 3) { /* split needed */ tmpstr = curses_break_str(message, (width - 3), 1); -#if !defined(PDCURSES) || defined(PDC_WIDE) +#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE)) if (have_mixed_leadin) { mvwadd_wch(win, my, mx, mixed_leadin_cchar); ++mx; @@ -211,7 +214,7 @@ curses_message_win_puts(const char *message, boolean recursed) curses_message_win_puts(tmpstr, TRUE); free(tmpstr); } else { -#if !defined(PDCURSES) || defined(PDC_WIDE) +#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE)) if (have_mixed_leadin) { mvwadd_wch(win, my, mx, mixed_leadin_cchar); ++mx; @@ -227,7 +230,7 @@ curses_message_win_puts(const char *message, boolean recursed) wrefresh(win); } - +#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE)) static int curscolor(int nhcolor, boolean *boldon) { @@ -255,6 +258,7 @@ curscolor(int nhcolor, boolean *boldon) } return curses_color; } +#endif void curses_got_input(void) {