aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-03-31 14:07:04 -0600
committerTom Tromey <tromey@adacore.com>2020-03-31 14:09:36 -0600
commit6f29a53415003fd958978471801c072b2fcc8f80 (patch)
treedef56d094c8a333876267edc8a4dad6a5432ed30 /gdb
parentaf62665e1339d970ab8ea3e3260dbdbde0009c2d (diff)
downloadbinutils-6f29a53415003fd958978471801c072b2fcc8f80.zip
binutils-6f29a53415003fd958978471801c072b2fcc8f80.tar.gz
binutils-6f29a53415003fd958978471801c072b2fcc8f80.tar.bz2
Fix py-tui.c build problem
py-tui.c can fail to build if the ncurses development headers are not installed, but if Python was built against ncurses. In this case, the Python headers will define HAVE_NCURSES_H, confusing gdb_curses.h. This patch fixes the problem by moving this include inside "#ifdef TUI". gdb/ChangeLog 2020-03-31 Joel Jones <joelkevinjones@gmail.com> PR tui/25597: * python/py-tui.c: Include gdb_curses.h inside of #ifdef TUI.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/python/py-tui.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d3873da..116a9b3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-31 Joel Jones <joelkevinjones@gmail.com>
+
+ PR tui/25597:
+ * python/py-tui.c: Include gdb_curses.h inside of #ifdef TUI.
+
2020-03-31 Tom Tromey <tromey@adacore.com>
* dwarf2/abbrev.c (abbrev_table::read): Conditionally call
diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c
index 4cb86ae..de7c396 100644
--- a/gdb/python/py-tui.c
+++ b/gdb/python/py-tui.c
@@ -21,10 +21,16 @@
#include "defs.h"
#include "arch-utils.h"
#include "python-internal.h"
-#include "gdb_curses.h"
#ifdef TUI
+/* Note that Python's public headers may define HAVE_NCURSES_H, so if
+ we unconditionally include this (outside the #ifdef above), then we
+ can get a compile error when ncurses is not in fact installed. See
+ PR tui/25597; or the upstream Python bug
+ https://bugs.python.org/issue20768. */
+#include "gdb_curses.h"
+
#include "tui/tui-data.h"
#include "tui/tui-io.h"
#include "tui/tui-layout.h"