diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index c97e8fd1717..84cad9366d5 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -319,7 +319,9 @@ tui_apply_style (WINDOW *w, ui_file_style style) wattron (w, A_NORMAL); wattroff (w, A_BOLD); wattroff (w, A_DIM); +#ifdef A_ITALIC wattroff (w, A_ITALIC); +#endif wattroff (w, A_UNDERLINE); wattroff (w, A_REVERSE); if (last_color_pair != -1) @@ -368,8 +370,10 @@ tui_apply_style (WINDOW *w, ui_file_style style) gdb_assert_not_reached ("invalid intensity"); } +#ifdef A_ITALIC if (style.is_italic ()) wattron (w, A_ITALIC); +#endif if (style.is_underline ()) wattron (w, A_UNDERLINE); diff --git a/gdb/ui-style.c b/gdb/ui-style.c index 9a58e4dd2ae..d450c3e6079 100644 --- a/gdb/ui-style.c +++ b/gdb/ui-style.c @@ -594,7 +594,11 @@ colorsupport () { std::vector result = {color_space::MONOCHROME}; - int colors = tgetnum ("Co"); + /* ncurses versions prior to 6.1 (and other curses + implementations) declare the tgetnum argument to be + 'char *', so we need the const_cast, since C++ will not + implicitly convert. */ + int colors = tgetnum (const_cast ("Co")); if (colors >= 8) result.push_back (color_space::ANSI_8COLOR); if (colors >= 16)