From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/build] Fix build without ncurses in maintenance_info_screen
Date: Sat, 29 Apr 2023 07:04:48 +0200 [thread overview]
Message-ID: <20230429050448.11802-1-tdevries@suse.de> (raw)
With a build without ncurses we run into:
...
src/gdb/utils.c: In function ‘void maintenance_info_screen(const char*, int)’:
src/gdb/utils.c:1310:7: error: ‘COLS’ was not declared in this scope
COLS);
^~~~
src/gdb/utils.c:1331:8: error: ‘LINES’ was not declared in this scope
LINES);
^~~~~
...
Fix this by using HAVE_LIBCURSES.
Tested on x86_64-linux.
PR build/30391
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30391
---
gdb/utils.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdb/utils.c b/gdb/utils.c
index b5bb84ce85d..002a5885aff 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1304,10 +1304,12 @@ maintenance_info_screen (const char *args, int from_tty)
? " (unlimited - 1)"
: "")));
+#ifdef HAVE_LIBCURSES
gdb_printf (gdb_stdout,
_("Number of characters curses thinks "
"are in a line is %d.\n"),
COLS);
+#endif
gdb_printf (gdb_stdout,
_("Number of characters environment thinks "
@@ -1325,10 +1327,12 @@ maintenance_info_screen (const char *args, int from_tty)
rows,
rows == sqrt_int_max ? " (unlimited)" : "");
+#ifdef HAVE_LIBCURSES
gdb_printf (gdb_stdout,
_("Number of lines curses thinks "
"are in a page is %d.\n"),
LINES);
+#endif
gdb_printf (gdb_stdout,
_("Number of lines environment thinks "
base-commit: 1b05f1083a4e18e5141ddce7551b79d07d9b272d
--
2.35.3
reply other threads:[~2023-04-29 5:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230429050448.11802-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).