Rebuild configure and defs.h.in from new configure.in, and update code to match.
This simplifies the inclusion logic in ircterm.h, and updates term.c to include
term.h if available. This removes the declarations for setupterm(), tigetstr(),
tigetnum(), tigetflag(), tgetent(), tgetstr(), tgetnum() and tgetflag() from
term.c as those should be defined in term.h or termcap.h.
This should make the system declaration of tparm() available to term.c, which
will fix a crash on NetBSD x86-64 caused by the implicit declaration of tparm()
having a return type of 'int' while the real function has a return type of
'char *'.
We have to include term.h in term.c, not in ircterm.h because term.h defines
a large number of macros, at least two of which ('lines' and 'goto_window')
conflict with names in use in the rest of the codebase.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@435 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -159,6 +159,9 @@
|
|||||||
/* Define to 1 if you have the <ncurses/termcap.h> header file. */
|
/* Define to 1 if you have the <ncurses/termcap.h> header file. */
|
||||||
#undef HAVE_NCURSES_TERMCAP_H
|
#undef HAVE_NCURSES_TERMCAP_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <ncurses/term.h> header file. */
|
||||||
|
#undef HAVE_NCURSES_TERM_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <ndir.h> header file. */
|
/* Define to 1 if you have the <ndir.h> header file. */
|
||||||
#undef HAVE_NDIR_H
|
#undef HAVE_NDIR_H
|
||||||
|
|
||||||
@@ -297,11 +300,11 @@
|
|||||||
/* Define to 1 if you have the <termios.h> header file. */
|
/* Define to 1 if you have the <termios.h> header file. */
|
||||||
#undef HAVE_TERMIOS_H
|
#undef HAVE_TERMIOS_H
|
||||||
|
|
||||||
/* Define this if you have the tparm function in an included lib. */
|
/* Define to 1 if you have the <term.h> header file. */
|
||||||
#undef HAVE_TPARM
|
#undef HAVE_TERM_H
|
||||||
|
|
||||||
/* Define this if you have the tputs function in an included lib. */
|
/* Define to 1 if you have the `tparm' function. */
|
||||||
#undef HAVE_TPUTS
|
#undef HAVE_TPARM
|
||||||
|
|
||||||
/* Define to 1 if you have the `uname' function. */
|
/* Define to 1 if you have the `uname' function. */
|
||||||
#undef HAVE_UNAME
|
#undef HAVE_UNAME
|
||||||
@@ -396,12 +399,6 @@
|
|||||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||||
#undef TIME_WITH_SYS_TIME
|
#undef TIME_WITH_SYS_TIME
|
||||||
|
|
||||||
/* Define this if tparm is declared in termcap.h. */
|
|
||||||
#undef TPARM_DECLARED
|
|
||||||
|
|
||||||
/* Define this if tputs is declared in termcap.h. */
|
|
||||||
#undef TPUTS_DECLARED
|
|
||||||
|
|
||||||
/* Define your maildir here. */
|
/* Define your maildir here. */
|
||||||
#undef UNIX_MAIL
|
#undef UNIX_MAIL
|
||||||
|
|
||||||
|
|||||||
@@ -13,23 +13,18 @@
|
|||||||
#ifndef IRCTERM_H_
|
#ifndef IRCTERM_H_
|
||||||
# define IRCTERM_H_
|
# define IRCTERM_H_
|
||||||
|
|
||||||
#ifdef HAVE_NCURSES_H
|
#if defined(HAVE_NCURSES_H)
|
||||||
#include <ncurses.h>
|
#include <ncurses.h>
|
||||||
# ifdef HAVE_NCURSES_TERMCAP_H
|
#elif defined(HAVE_CURSES_H)
|
||||||
# include <ncurses/termcap.h>
|
|
||||||
# elif defined(HAVE_TERMCAP_H)
|
|
||||||
# ifndef __CYGWIN__
|
|
||||||
# include <termcap.h>
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# ifdef HAVE_CURSES_H
|
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#endif
|
#endif
|
||||||
# ifdef HAVE_TERMCAP_H
|
|
||||||
|
#if defined(HAVE_NCURSES_TERMCAP_H)
|
||||||
|
#include <ncurses/termcap.h>
|
||||||
|
#elif defined(HAVE_TERMCAP_H)
|
||||||
#include <termcap.h>
|
#include <termcap.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#ifdef __EMX__
|
#ifdef __EMX__
|
||||||
#include <termcap.h>
|
#include <termcap.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ DWORD gdwPlatform;
|
|||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
#if defined(HAVE_NCURSES_TERM_H)
|
||||||
|
#include <ncurses/term.h>
|
||||||
|
#elif defined(HAVE_TERM_H)
|
||||||
|
#include <term.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static int tty_des; /* descriptor for the tty */
|
static int tty_des; /* descriptor for the tty */
|
||||||
|
|
||||||
static struct termios oldb, newb;
|
static struct termios oldb, newb;
|
||||||
@@ -66,18 +72,10 @@ extern int already_detached;
|
|||||||
|
|
||||||
/* Systems cant seem to agree where to put these... */
|
/* Systems cant seem to agree where to put these... */
|
||||||
#ifdef HAVE_TERMINFO
|
#ifdef HAVE_TERMINFO
|
||||||
extern int setupterm();
|
|
||||||
extern char *tigetstr();
|
|
||||||
extern int tigetnum();
|
|
||||||
extern int tigetflag();
|
|
||||||
#define Tgetstr(x, y) ((void)&(y), tigetstr((x).iname))
|
#define Tgetstr(x, y) ((void)&(y), tigetstr((x).iname))
|
||||||
#define Tgetnum(x) tigetnum(x.iname);
|
#define Tgetnum(x) tigetnum(x.iname);
|
||||||
#define Tgetflag(x) tigetflag(x.iname);
|
#define Tgetflag(x) tigetflag(x.iname);
|
||||||
#else
|
#else
|
||||||
extern int tgetent();
|
|
||||||
extern char *tgetstr();
|
|
||||||
extern int tgetnum();
|
|
||||||
extern int tgetflag();
|
|
||||||
#define Tgetstr(x, y) tgetstr(x.tname, &y)
|
#define Tgetstr(x, y) tgetstr(x.tname, &y)
|
||||||
#define Tgetnum(x) tgetnum(x.tname)
|
#define Tgetnum(x) tgetnum(x.tname)
|
||||||
#define Tgetflag(x) tgetflag(x.tname)
|
#define Tgetflag(x) tgetflag(x.tname)
|
||||||
@@ -1258,9 +1256,9 @@ void tty_dup(int tty)
|
|||||||
dup2(tty, tty_des);
|
dup2(tty, tty_des);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset_lines(int lines)
|
void reset_lines(int nlines)
|
||||||
{
|
{
|
||||||
li = lines;
|
li = nlines;
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset_cols(int cols)
|
void reset_cols(int cols)
|
||||||
|
|||||||
Reference in New Issue
Block a user