This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix tui compilation with Solaris libcurses (PR tui/21482)


Hi Pedro,

>>> Ok for mainline and 8.0 branch?
>>
>> The cast bits are OK.  I'd like to hear your opinion on
>> moving the NOMACROS define to gdb_curses.h, before including
>> <curses.h>.
>
> The move makes sense to me: I just wasn't aware of that file.  I'll
> prepare a separate patch.

I've checked in the cast part now.  Here's the NOMACROS part for
gdb_curses.h.  Tested as before on sparcv9-sun-solaris2.10 (curses) and
amd64-pc-solaris2.12 (ncurses).  Ok too?

Interestingly, with that patch the previous link failure on Solaris
11/12 (missing wattr_on/wattr_off) is gone, too.  This seems to happen
because <ncurses/ncurses.h> no longer defines

/usr/include/ncurses/ncurses.h:#define wattron(win,at)          wattr_on(win, NCURSES_CAST(attr_t, at), NULL)
/usr/include/ncurses/ncurses.h:#define attr_on(a,o)             wattr_on(stdscr,a,o)

and the references to wattron can be satisfied from libcurses just as
from libncurses.

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2017-05-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR tui/21482
	* gdb_curses.h (NOMACROS): Define.
	(NCURSES_NOMACROS): Define.

# HG changeset patch
# Parent  32840d58190409875fc9d8590fcb97eafaaeeca3
Fix tui compilation with Solaris libcurses: clear define (PR tui/21482)

diff --git a/gdb/gdb_curses.h b/gdb/gdb_curses.h
--- a/gdb/gdb_curses.h
+++ b/gdb/gdb_curses.h
@@ -32,6 +32,13 @@
 #undef KEY_EVENT
 #endif
 
+/* On Solaris and probably other SysVr4 derived systems, we need to define
+   NOMACROS so the native <curses.h> doesn't define clear which interferes
+   with the clear member of class string_file.  ncurses potentially has a
+   similar problem and fix.  */
+#define NOMACROS
+#define NCURSES_NOMACROS
+
 #if defined (HAVE_NCURSES_NCURSES_H)
 #include <ncurses/ncurses.h>
 #elif defined (HAVE_NCURSES_H)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]