Patchwork [FYI] Fix another build failure in tui-selftests.c

login
register
mail settings
Submitter Tom Tromey
Date Dec. 4, 2019, 3:10 p.m.
Message ID <20191204151015.25326-1-tromey@adacore.com>
Download mbox | patch
Permalink /patch/36510/
State New
Headers show

Comments

Tom Tromey - Dec. 4, 2019, 3:10 p.m.
Christian had emailed me to say that the TUI unit test broke the mingw
build, but I erroneously thought this was fixed by the earlier patch
that made the test body conditional on the TUI being built.

However, I was wrong about this -- tui-selftests.c unconditionally
includes tui-winsource.h, which fails if curses is not available.

This patch fixes the build problem by moving this include into the
"#ifdef TUI" section.

Tested by rebuilding a mingw-hosted gdb.

gdb/ChangeLog
2019-12-04  Tom Tromey  <tromey@adacore.com>

	* unittests/tui-selftests.c: Conditionally include tui-winsource.h.

Change-Id: If608649ef5cbef8ea92192e11c53379742967ee7
---
 gdb/ChangeLog                 | 4 ++++
 gdb/unittests/tui-selftests.c | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/gdb/unittests/tui-selftests.c b/gdb/unittests/tui-selftests.c
index 95c12e3f5d2..03969ea8ef6 100644
--- a/gdb/unittests/tui-selftests.c
+++ b/gdb/unittests/tui-selftests.c
@@ -19,10 +19,11 @@ 
 
 #include "defs.h"
 #include "gdbsupport/selftest.h"
-#include "tui/tui-winsource.h"
 
 #ifdef TUI
 
+#include "tui/tui-winsource.h"
+
 namespace selftests {
 namespace tui {