Re: [tig] Re: compilation error: undefined reference to `set_tabsize'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 20, 2010 at 06:05:59PM -0500, Kumar Appaiah wrote:
> On Mon, Sep 20, 2010 at 10:43:44PM +0200, Nicolas Sebrecht wrote:
> > > That change works for me on Cygwin, Ubuntu 10.04, Debian 5.0.6
> > > 
> > > Maybe you should say something about your system/OS version ?
> > 
> > Naturally. I'm running on Gentoo.
> > 
> 
> Ack that this also breaks build on CentOS. The simple reason is that
> the ncurses version on CentOS 5.5 is ncurses-5.5, while that on Debian
> Lenny is 5.7+. According to the changelog, 5.6 onwards has
> set_tabsize, so checking for that version of ncurses might be a good
> option.

I have attached a patch which uses the patch number to determine this:


HTH, Thanks!

Kumar

>From d10b7f15160b7d8da74f899f25018591cb33eec0 Mon Sep 17 00:00:00 2001
From: Kumar Appaiah <a.kumar@xxxxxxxxxxxxxxxxx>
Date: Mon, 20 Sep 2010 18:10:11 -0500
Subject: [PATCH] Check the ncurse version before using set_tabsize

This patch checks the ncurses patch level to decide if set_tabsize is
to be used in place of the TABSIZE macro, for setting the tab size.
---
 tig.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tig.c b/tig.c
index 7bc5daa..01b55d7 100644
--- a/tig.c
+++ b/tig.c
@@ -7111,7 +7111,11 @@ init_display(void)
 	keypad(status_win, TRUE);
 	wbkgdset(status_win, get_line_attr(LINE_STATUS));
 
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20080119)
 	set_tabsize(opt_tab_size);
+#else
+	TABSIZE = opt_tab_size;
+#endif
 
 	term = getenv("XTERM_VERSION") ? NULL : getenv("COLORTERM");
 	if (term && !strcmp(term, "gnome-terminal")) {
-- 
1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]