From: Taylor R Campbell Date: Mon, 9 Aug 2010 16:36:32 +0000 (+0000) Subject: Check for termcap.h too. X-Git-Tag: 20101212-Gtk~114 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=34f11ba838fc796ab7fe45b386958fb22317cd71;p=mit-scheme.git Check for termcap.h too. Assume that term.h or termcap.h defines BC, UP, PC, & ospeed. Work around !*@#@^!*#%!^&$@!%# stupidity in NetBSD with ospeed. --- diff --git a/src/microcode/configure.ac b/src/microcode/configure.ac index b7fb859cf..edb9474bb 100644 --- a/src/microcode/configure.ac +++ b/src/microcode/configure.ac @@ -692,7 +692,7 @@ dnl by pretending we know the format -- without bringing in the local dnl termcap reimplementation. dnl Go for whatever header files we can. -AC_CHECK_HEADERS([ncurses.h curses.h term.h]) +AC_CHECK_HEADERS([ncurses.h curses.h term.h termcap.h]) if test "x${with_termcap}" = xyes; then @@ -756,6 +756,7 @@ no) ;; OPTIONAL_BASES="${OPTIONAL_BASES} tparam" fi fi + ;; esac dnl The OpenSSL crypto library provides support for blowfish and MD5. diff --git a/src/microcode/tterm.c b/src/microcode/tterm.c index f84dea010..5bab89808 100644 --- a/src/microcode/tterm.c +++ b/src/microcode/tterm.c @@ -45,8 +45,18 @@ USA. # endif #endif -#if defined(HAVE_TERM_H) -# include +/* Some instances of curses.h (I'm looking at you, NetBSD) not only + declare an external variable ospeed, but also define it to be a + macro expanding to a function call. WTF? Unix sucks. */ +#undef ospeed + +#if defined(HAVE_TERM_H) || defined(HAVE_TERMCAP_H) +# ifdef HAVE_TERM_H +# include +# endif +# ifdef HAVE_TERMCAP_H +# include +# endif #else extern int tgetent (char *, const char *); extern int tgetnum (const char *); @@ -54,13 +64,13 @@ USA. extern char * tgetstr (const char *, char **); extern char * tgoto (const char *, int, int); extern int tputs (const char *, int, int (*) (int)); + extern char * BC; + extern char * UP; + extern char PC; + extern speed_t ospeed; #endif extern char * tparam (const char *, void *, int, ...); -extern char * BC; -extern char * UP; -extern char PC; -extern speed_t ospeed; #ifndef TERMCAP_BUFFER_SIZE #define TERMCAP_BUFFER_SIZE 2048