Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

termcap/terminfo includes



Hi

NetBSD recently gained terminfo and zsh is now failing to build.
The exact error is due to a zsh definition vs our curses.h underscore() function.

Looking through the code, I see no reason why either termcap or terminfo code should include curses header as no curses calls are made. Also, it is an unsafe assumption that either curses.h or term.h pulls in termcap.h for the function decs.

Attached is a patch to cvs HEAD.

Thanks

Roy

PS, not subed to the list as I'm not a zsh user - just fixing a problem, so reply directly.
Index: Src/Modules/termcap.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/termcap.c,v
retrieving revision 1.27
diff -u -p -r1.27 termcap.c
--- Src/Modules/termcap.c	11 Nov 2009 16:26:19 -0000	1.27
+++ Src/Modules/termcap.c	7 Feb 2010 11:48:43 -0000
@@ -36,13 +36,7 @@
 #include "../../config.h"
 
 #ifdef HAVE_TGETENT
-# if defined(ZSH_HAVE_CURSES_H) && defined(ZSH_HAVE_TERM_H)
-#  define USES_TERM_H 1
-# else
-#  ifdef HAVE_TERMCAP_H
-#   define USES_TERMCAP_H 1
-#  endif
-# endif
+# define USES_TERMCAP_H 1
 #endif
 
 #include "termcap.mdh"
@@ -50,19 +44,7 @@
 
 /**/
 #ifdef HAVE_TGETENT
-# ifdef USES_TERM_H
-#  ifdef HAVE_TERMIO_H
-#   include <termio.h>
-#  endif
-#  ifdef ZSH_HAVE_CURSES_H
-#   include "../zshcurses.h"
-#  endif
-#  include "../zshterm.h"
-# else
-#  ifdef USES_TERMCAP_H
-#   include <termcap.h>
-#  endif
-# endif
+# include <termcap.h>
 
 #ifndef HAVE_BOOLCODES
 static char *boolcodes[] = {
@@ -367,15 +349,7 @@ enables_(Module m, int **enables)
 int
 boot_(Module m)
 {
-#ifdef HAVE_TGETENT
-# ifdef HAVE_SETUPTERM
-    int errret;
-    if (setupterm((char *)0, 1, &errret) == ERR) {
-	return 1;
-    }
-# endif
-#endif
-    return  0;
+    return 0;
 }
 
 /**/
Index: Src/Modules/terminfo.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v
retrieving revision 1.34
diff -u -p -r1.34 terminfo.c
--- Src/Modules/terminfo.c	13 Mar 2008 11:11:05 -0000	1.34
+++ Src/Modules/terminfo.c	7 Feb 2010 11:48:45 -0000
@@ -49,13 +49,7 @@
 #  undef offsetof
 # endif
 
-#ifdef ZSH_HAVE_CURSES_H
-# include "../zshcurses.h"
-#endif
-
-# ifdef ZSH_HAVE_TERM_H
-#  include "../zshterm.h"
-# endif
+#include <term.h>
 
 /* echoti: output a terminfo capability */
 


Messages sorted by: Reverse Date, Date, Thread, Author