Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: cygwin build problem - undefined setupterm
- X-seq: zsh-workers 14062
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>, "ZSH Workers Mailing List" <zsh-workers@xxxxxxxxxx>
- Subject: PATCH: Re: cygwin build problem - undefined setupterm
- Date: Sat, 21 Apr 2001 21:33:59 +0000
- In-reply-to: <000601c0ca5f$aadba880$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <000601c0ca5f$aadba880$21c9ca95@xxxxxxxxxxxxxx>
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 <termcap.h>
-# ifdef HAVE_TERM_H
-# include <term.h>
-# endif
-# else
+# if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
# ifdef HAVE_TERMIO_H
# include <termio.h>
-# endif
-# ifdef HAVE_CURSES_H
-# include <curses.h>
# endif
-# ifdef HAVE_TERM_H
-# include <term.h>
+# include <curses.h>
+# include <term.h>
+# else
+# ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+# else
+# ifdef HAVE_CURSES_H
+# include <curses.h>
+# endif
+# ifdef HAVE_TERM_H
+# include <term.h>
+# 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author