zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: <zsh-workers@sunsite.dk>
Subject: Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
Date: Fri, 13 Apr 2001 03:51:01 +0000	[thread overview]
Message-ID: <1010413035101.ZM981@candle.brasslantern.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0104121754580.5377-100000@phong.blorf.net>

On Apr 12,  6:13pm, Wayne Davison wrote:
}
} The underlying problem here is that curses.h omits including termio.h
} if VINTR is defined, and while termios.h defines VINTR, it doesn't
} define the termio struct, and term.h puts a termio struct into its
} term struct.

The solution wouldn't happen to be the same as the one for __sco that's
already in Src/system.h, would it?

I suppose not, since it seems to be the opposite problem.

} I can get terminfo.c to compile by either including termio.h before I
} include term.h, or by undefining VINTR before including curses.h.  Any
} ideas on what is a good, portable solution?

I suppose we can insert <termio.h> between the #includes of <curses.h> and
<term.h> in terminfo.c (relative to my patch in 13968), but my concern is
that including both <termio.h> (there) and <termios.h> (from system.h) will
choke on some other operating system.

} Can we stomache adding this before the curses.h include:
} 
} # ifdef VINTR
} #  undef VINTR
} # endif

If that's isolated to Src/Modules/terminfo.c, I don't see any reason why
not.
 
} On a slightly related note, anyone know what the "offsetof" define is
} doing in system.h?  It doesn't appear to be used anywhere, and the new
} include of term.h causes it to be redefined (on Solaris).

It's not in the 3.0 sources, but it's been in the 3.1 sources for as long
as I've been keeping track of them (which is only since 3.1.4, I guess).

Might as well #undef offsetof at the same time as #undef VINTR.

Here's another shot at a complete patch (including what was in 13968):

Index: Src/prototypes.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/prototypes.h,v
retrieving revision 1.3
diff -u -r1.3 prototypes.h
--- Src/prototypes.h	2001/04/12 17:11:40	1.3
+++ Src/prototypes.h	2001/04/13 03:49:17
@@ -33,7 +33,7 @@
 char *calloc _((size_t, size_t));
 #endif
 
-#if !(defined(HAVE_TERMCAP_H) || defined(HAVE_TERM_H))
+#if !(defined(USES_TERMCAP_H) || defined(USES_TERM_H))
 extern int tgetent _((char *bp, char *name));
 extern int tgetnum _((char *id));
 extern int tgetflag _((char *id));
Index: Src/system.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/system.h,v
retrieving revision 1.13
diff -u -r1.13 system.h
--- Src/system.h	2001/04/12 17:11:39	1.13
+++ Src/system.h	2001/04/13 03:49:22
@@ -310,14 +310,6 @@
 # endif  /* HAVE_TERMIO_H  */
 #endif   /* HAVE_TERMIOS_H */
 
-#ifdef HAVE_TERMCAP_H
-# include <termcap.h>
-#else
-# ifdef HAVE_TERM_H
-#  include <term.h>
-# endif
-#endif
-
 #if defined(GWINSZ_IN_SYS_IOCTL) || defined(CLOBBERS_TYPEAHEAD)
 # include <sys/ioctl.h>
 #endif
Index: Src/Modules/termcap.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/termcap.c,v
retrieving revision 1.3
diff -u -r1.3 termcap.c
--- Src/Modules/termcap.c	2001/04/09 15:58:55	1.3
+++ Src/Modules/termcap.c	2001/04/13 03:49:24
@@ -27,12 +27,16 @@
  *
  */
 
+#define USES_TERMCAP_H 1
 #include "termcap.mdh"
 #include "termcap.pro"
 
 /* echotc: output a termcap */
 
 #ifdef HAVE_TGETENT
+# ifdef HAVE_TERMCAP_H
+#  include <termcap.h>
+# endif
 
 /**/
 static int
Index: Src/Modules/terminfo.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v
retrieving revision 1.13
diff -u -r1.13 terminfo.c
--- Src/Modules/terminfo.c	2001/04/12 17:11:40	1.13
+++ Src/Modules/terminfo.c	2001/04/13 03:49:28
@@ -27,6 +27,7 @@
  *
  */
 
+#define USES_TERM_H 1
 #include "terminfo.mdh"
 #include "terminfo.pro"
 
@@ -34,8 +35,20 @@
 
 /**/
 #ifdef HAVE_TIGETSTR
+
+/* The following two undefs are needed for Solaris 2.6 */
+# ifdef VINTR
+#  undef VINTR
+# endif
+# ifdef offsetof
+#  undef offsetof
+# endif
+
 # ifdef HAVE_CURSES_H
 #  include <curses.h>
+# endif
+# ifdef HAVE_TERM_H
+#  include <term.h>
 # endif
 
 static Param terminfo_pm;

-- 
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   


  reply	other threads:[~2001-04-13  3:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-12 14:33 Vin Shelton
2001-04-12 14:54 ` PATCH: " Clint Adams
2001-04-12 15:39   ` Bart Schaefer
2001-04-12 15:57     ` Bart Schaefer
2001-04-12 16:20       ` Bart Schaefer
2001-04-12 22:29         ` Wayne Davison
2001-04-12 23:08           ` Bart Schaefer
2001-04-13  1:13             ` Wayne Davison
2001-04-13  3:51               ` Bart Schaefer [this message]
2001-04-13  8:00                 ` Wayne Davison
2001-04-13 16:42                   ` Bart Schaefer
2001-04-13 16:49                     ` Wayne Davison
2001-04-12 15:28 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1010413035101.ZM981@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).