From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9331 invoked from network); 21 Apr 2001 21:34:44 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Apr 2001 21:34:44 -0000 Received: (qmail 16635 invoked by alias); 21 Apr 2001 21:34:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14062 Received: (qmail 16621 invoked from network); 21 Apr 2001 21:34:36 -0000 From: "Bart Schaefer" Message-Id: <1010421213359.ZM25863@candle.brasslantern.com> Date: Sat, 21 Apr 2001 21:33:59 +0000 In-Reply-To: <000601c0ca5f$aadba880$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "cygwin build problem - undefined setupterm" (Apr 21, 4:36pm) References: <000601c0ca5f$aadba880$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Andrej Borsenkow" , "ZSH Workers Mailing List" Subject: PATCH: Re: cygwin build problem - undefined setupterm MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii The build on my RedHat 5.2 machine is also broken by the latest termcap.c changes: In file included from ../../../new/Src/Modules/termcap.c:43: /usr/include/term.h:710: conflicting types for `tputs' /usr/include/termcap.h:57: previous declaration of `tputs' /usr/include/term.h:725: conflicting types for `tgetent' /usr/include/termcap.h:43: previous declaration of `tgetent' ../../../new/Src/Modules/termcap.c: In function `cleanup_': ../../../new/Src/Modules/termcap.c:374: warning: unused variable `pm' See my remarks about term.h and termcap.h in 14056. You can't use both termcap and ncurses at the same time. I really don't know whether the following is any better everywhere, but it seems to fix the compile/link problems on my system. The unused variable was a result of a typo in an #ifdef. Index: Src/Modules/termcap.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/termcap.c,v retrieving revision 1.6 diff -u -r1.6 termcap.c --- Src/Modules/termcap.c 2001/04/20 14:22:24 1.6 +++ Src/Modules/termcap.c 2001/04/21 21:32:05 @@ -37,20 +37,22 @@ /* echotc: output a termcap */ #ifdef HAVE_TGETENT -# ifdef HAVE_TERMCAP_H -# include -# ifdef HAVE_TERM_H -# include -# endif -# else +# if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H) # ifdef HAVE_TERMIO_H # include -# endif -# ifdef HAVE_CURSES_H -# include # endif -# ifdef HAVE_TERM_H -# include +# include +# include +# else +# ifdef HAVE_TERMCAP_H +# include +# else +# ifdef HAVE_CURSES_H +# include +# endif +# ifdef HAVE_TERM_H +# include +# endif # endif # endif @@ -356,7 +358,9 @@ boot_(Module m) { #ifdef HAVE_TGETENT +# if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H) setupterm((char *)0, 1, (int *)0); +# endif if (!createtchash()) return 1; @@ -376,7 +380,7 @@ incleanup = 1; -#ifdef HAVE_TGETENTR +#ifdef HAVE_TGETENT if ((pm = (Param) paramtab->getnode(paramtab, termcap_nam)) && pm == termcap_pm) { pm->flags &= ~PM_READONLY; -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net