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

Re: Zsh 4.3.8 released



Thorsten Kampe wrote:
> 4.3.8 also doesn't compile under Cygwin (while 4.3.6 dev 2 did)

I can't actually see any change that could be related.

> ./configure goes through but make gives:
> 
> make[3]: Entering directory `/cygdrive/c/data/compile/zsh-
> 4.3.8/Src/Modules'
> gcc -c -I.  -DHAVE_CONFIG_H -O3 -pipe  -o termcap.o termcap.c
> termcap.c: In function `scantermcap':
> termcap.c:238: error: `_nc_strcodes' declared as function returning an 
> array

This implies HAVE_STRCODES is not defined but strcodes is supplied
anyway.  It might be worth looking in config.log to see if the test for
strcodes threw up any odd errors (e.g. didn't compile for some spurious
reason).  Possibly there is yet more grief to do with ordering of tests
for terminal-related headers and libraries, though this hasn't changed
for months.

We could work around this as follows, and the change looks entirely
benign, but I suspect the problems in configure mean this isn't the
right fix.

Index: Src/Modules/termcap.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/termcap.c,v
retrieving revision 1.25
diff -u -r1.25 termcap.c
--- Src/Modules/termcap.c	13 Mar 2008 11:11:04 -0000	1.25
+++ Src/Modules/termcap.c	30 Oct 2008 09:40:10 -0000
@@ -235,7 +235,7 @@
 #endif
 
 #ifndef HAVE_STRCODES
-    static char *strcodes[] = {
+    static char *zstrcodes[] = {
 	"ac", "bt", "bl", "cr", "ZA", "ZB", "ZC", "ZD", "cs", "rP", "ct",
 	"MC", "cl", "cb", "ce", "cd", "ch", "CC", "CW", "cm", "do", "ho",
 	"vi", "le", "CM", "ve", "nd", "ll", "up", "vs", "ZE", "dc", "dl",
@@ -302,7 +302,13 @@
     pm->node.flags = PM_READONLY | PM_SCALAR;
     pm->gsu.s = &nullsetscalar_gsu;
 
-    for (capcode = (char **)strcodes; *capcode; capcode++) {
+    for (capcode = (char **)
+#ifdef HAVE_STRCODES
+	     strcodes
+#else
+	     zstrcodes
+#endif
+	     ; *capcode; capcode++) {
 	if ((tcstr = (char *)tgetstr(*capcode,&u)) != NULL &&
 	    tcstr != (char *)-1) {
 	    pm->u.str = dupstring(tcstr);


-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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