summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-04-26 14:35:53 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-04-26 14:35:53 +0000
commit17539b1e2c0555985829e068a2accb7676744351 (patch)
tree19cc774a4a91f76f2f900cb18bafb0f4ee10166c
parentefe55f77a369fa38f8d9ffaf10499f73b441a390 (diff)
downloadzsh-17539b1e2c0555985829e068a2accb7676744351.tar.gz
zsh-17539b1e2c0555985829e068a2accb7676744351.tar.xz
zsh-17539b1e2c0555985829e068a2accb7676744351.zip
Another HAVE_TERM* compilation tweak.
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/termcap.c35
2 files changed, 27 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 96cd1cd74..f33f63631 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-04-26  Bart Schaefer  <schaefer@zsh.org>
+
+	* 14108: Src/Modules/termcap.c: Don't define USES_TERM* if the
+	corresponding HAVE_TERM* constants are not defined.
+
 2001-04-26  Oliver Kiddle  <opk@zsh.org>
 
 	* 14112: Completion/Base/Utility/.distfiles,
diff --git a/Src/Modules/termcap.c b/Src/Modules/termcap.c
index 845d29f6d..e48c8a16f 100644
--- a/Src/Modules/termcap.c
+++ b/Src/Modules/termcap.c
@@ -27,37 +27,46 @@
  *
  */
 
-#define USES_TERMCAP_H 1
-#define USES_TERM_H 1
+/*
+ * We need to include the zsh headers later to avoid clashes with
+ * the definitions on some systems, however we need the configuration
+ * file to decide whether we should avoid curses.h, which clashes
+ * with several zsh constants on some systems (e.g. SunOS 4).
+ */
+#include "../../config.h"
+
+#ifdef HAVE_TGETENT
+# if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
+#  define USES_TERM_H 1
+# else
+#  ifdef HAVE_TERMCAP_H
+#   define USES_TERMCAP_H 1
+#  endif
+# endif
+#endif
+
 #include "termcap.mdh"
 #include "termcap.pro"
 
 static char termcap_nam[] = "termcap";
 
-/* echotc: output a termcap */
-
 #ifdef HAVE_TGETENT
-# if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
+# ifdef USES_TERM_H
 #  ifdef HAVE_TERMIO_H
 #   include <termio.h>
 #  endif
 #  include <curses.h>
 #  include <term.h>
 # else
-#  ifdef HAVE_TERMCAP_H
+#  ifdef USES_TERMCAP_H
 #   include <termcap.h>
-#  else
-#   ifdef HAVE_CURSES_H
-#    include <curses.h>
-#   endif
-#   ifdef HAVE_TERM_H
-#    include <term.h>
-#   endif
 #  endif
 # endif
 
 static Param termcap_pm;
 
+/* echotc: output a termcap */
+
 /**/
 static int
 bin_echotc(char *name, char **argv, char *ops, int func)