From patchwork Sat Apr 29 05:04:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 68532 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A08953858C20 for ; Sat, 29 Apr 2023 05:04:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A08953858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682744698; bh=e7cq6duYffNoswcM40CtpgCVxHEqufFRKcKJNcEd/BU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=t+ZlRCceXMKimkOcq2f/vXmpsIEEFDgXOBejnTPeBX4BE2OU+rpikvMd4o0BjcoNG aaislTrrrY+A2J0lARLvuUP5XdAKnLfnGBRV5d0fbh1X3x3oT5xeuDs5b5BPc9hSYy p+zJXGT5XN3gc0+2JsNpJDi5WRWVobC6pjVa7UuA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id B2CB13858CDB for ; Sat, 29 Apr 2023 05:04:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B2CB13858CDB Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 663981FD77 for ; Sat, 29 Apr 2023 05:04:34 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 525EE13587 for ; Sat, 29 Apr 2023 05:04:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1v32EmKlTGQ5KQAAMHmgww (envelope-from ) for ; Sat, 29 Apr 2023 05:04:34 +0000 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 Message-Id: <20230429050448.11802-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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(+) base-commit: 1b05f1083a4e18e5141ddce7551b79d07d9b272d 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 "