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

Re: Compile errors for zsh 4.0.4 on Aix 4.3.3



В Чтв, 09.05.2002, в 19:31, Borsenkow Andrej написал:
> Stupid me. There is no need to test for declaration. Just test for
> availability and #define if available. Else simply use local name that
> do not clash.
> 
> Whose baby termcap/terminfo is? I am afraid to touch it :-)
> 

OTOH why not :-)

Could you try this patch?

-andrej
Index: Etc/MACHINES
===================================================================
RCS file: /cvsroot/zsh/zsh/Etc/MACHINES,v
retrieving revision 1.12.4.2
diff -u -r1.12.4.2 MACHINES
--- Etc/MACHINES	23 Oct 2001 06:44:05 -0000	1.12.4.2
+++ Etc/MACHINES	9 May 2002 15:44:02 -0000
@@ -89,12 +89,6 @@
 	4.1, though native cc works. More information about this problem
 	would be appreciated.
 
-	It was reported, that at least some 4.x versions have problem
-	with curses - variables boolcodes and some other are declared
-	in term.h but missing is libcurses.a. That makes native compiler
-	very unhappy (GCC 3.0 apparently does not mind). Zsh now defaults
-	to termcap on AIX; any info about this problem is appreciated.
-
 Linux: Linux 2.* (various 32-bit and 64-bit processors)
 	Should build `out-of-the-box'.
 
Index: Src/Modules/termcap.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/termcap.c,v
retrieving revision 1.13.4.1
diff -u -r1.13.4.1 termcap.c
--- Src/Modules/termcap.c	18 Jun 2001 17:40:52 -0000	1.13.4.1
+++ Src/Modules/termcap.c	9 May 2002 15:44:03 -0000
@@ -67,8 +67,10 @@
 
 static Param termcap_pm;
 
-#ifndef HAVE_BOOLCODES
-static char *boolcodes[] = {
+#ifdef HAVE_BOOLCODES
+#define zsh_boolcodes boolcodes
+#else
+static char *zsh_boolcodes[] = {
     "bw", "am", "ut", "cc", "xs", "YA", "YF", "YB", "xt", "xn", "eo",
     "gn", "hc", "HC", "km", "YC", "hs", "hl", "in", "YG", "da", "db",
     "mi", "ms", "nx", "xb", "NP", "ND", "NR", "os", "5i", "YD", "YE",
@@ -89,7 +91,7 @@
     case -1:
 	break;
     case 0:
-	for (b = (char **)boolcodes; *b; ++b)
+	for (b = (char **)zsh_boolcodes; *b; ++b)
 	    if (s[0] == (*b)[0] && s[1] == (*b)[1])
 		return 0;
 	break;
@@ -289,16 +291,20 @@
     int num;
     char **capcode, *tcstr, buf[2048], *u;
 
-#ifndef HAVE_NUMCODES
-    static char *numcodes[] = {
+#ifdef HAVE_NUMCODES
+#define zsh_numcodes numcodes
+#else
+    static char *zsh_numcodes[] = {
 	"co", "it", "lh", "lw", "li", "lm", "sg", "ma", "Co", "pa", "MW",
 	"NC", "Nl", "pb", "vt", "ws", "Yo", "Yp", "Ya", "BT", "Yc", "Yb",
 	"Yd", "Ye", "Yf", "Yg", "Yh", "Yi", "Yk", "Yj", "Yl", "Ym", "Yn",
 	NULL};
 #endif
 
-#ifndef HAVE_STRCODES
-    static char *strcodes[] = {
+#ifdef HAVE_STRCODES
+#define zsh_strcodes strcodes
+#else
+    static char *zsh_strcodes[] = {
 	"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",
@@ -350,7 +356,7 @@
     u = buf;
 
     pm->flags = PM_READONLY | PM_SCALAR;
-    for (capcode = (char **)boolcodes; *capcode; capcode++) {
+    for (capcode = (char **)zsh_boolcodes; *capcode; capcode++) {
 	if ((num = ztgetflag(*capcode)) != -1) {
 	    pm->u.str = num ? dupstring("yes") : dupstring("no");
 	    pm->nam = dupstring(*capcode);
@@ -359,7 +365,7 @@
     }
 
     pm->flags = PM_READONLY | PM_INTEGER;
-    for (capcode = (char **)numcodes; *capcode; capcode++) {
+    for (capcode = (char **)zsh_numcodes; *capcode; capcode++) {
 	if ((num = tgetnum(*capcode)) != -1) {
 	    pm->u.val = num;
 	    pm->nam = dupstring(*capcode);
@@ -368,7 +374,7 @@
     }
 
     pm->flags = PM_READONLY | PM_SCALAR;
-    for (capcode = (char **)strcodes; *capcode; capcode++) {
+    for (capcode = (char **)zsh_strcodes; *capcode; capcode++) {
 	if ((tcstr = (char *)tgetstr(*capcode,&u)) != NULL &&
 	    tcstr != (char *)-1) {
 	    pm->u.str = dupstring(tcstr);



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