From: Ezra Peisach Date: Sun, 8 Jul 2001 12:34:16 +0000 (+0000) Subject: * configure.in: Add AC_HEADER_STDARG X-Git-Tag: krb5-1.3-alpha1~1215 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=01a225e27c6816bfb17e9ed94d5f859b3916df2f;p=krb5.git * configure.in: Add AC_HEADER_STDARG * commands.c (call): Rewrite to use varargs/stdarg interface. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13589 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/telnet/telnet/ChangeLog b/src/appl/telnet/telnet/ChangeLog index 77e8e9b62..e1f6d8c47 100644 --- a/src/appl/telnet/telnet/ChangeLog +++ b/src/appl/telnet/telnet/ChangeLog @@ -1,3 +1,9 @@ +2001-07-08 Ezra Peisach + + * configure.in: Add AC_HEADER_STDARG. + + * commands.c (call): Rewrite to use varargs/stdarg interface. + 2001-07-06 Ezra Peisach * configure.in: Check if prototype needed for herror(). diff --git a/src/appl/telnet/telnet/commands.c b/src/appl/telnet/telnet/commands.c index cab1613a7..4ac736e4e 100644 --- a/src/appl/telnet/telnet/commands.c +++ b/src/appl/telnet/telnet/commands.c @@ -61,7 +61,11 @@ #include #include #include +#ifdef HAVE_STDARG_H +#include +#else #include +#endif #include #ifdef HAVE_VFORK_H #include @@ -124,7 +128,8 @@ extern int isprefix(); extern char **genget(); extern int Ambiguous(); -static int call (); +typedef int (*intrtn_t)(); +static int call (intrtn_t, ...); void cmdrc P((char *, char *)); static int send_tncmd P((void (*func)(), char *, char *)); @@ -2729,17 +2734,24 @@ static Command cmdtab2[] = { /*VARARGS1*/ static int -call(va_alist) +#ifdef HAVE_STDARG_H +call(intrtn_t routine, ...) +#else +call(routine, va_alist) + intrtn_t routine; va_dcl +#endif { va_list ap; - typedef int (*intrtn_t)(); - intrtn_t routine; char *args[100]; int argno = 0; +#ifdef HAVE_STDARG_H + va_start(ap, routine); +#else va_start(ap); - routine = (va_arg(ap, intrtn_t)); +#endif + while ((args[argno++] = va_arg(ap, char *)) != 0) { ; } diff --git a/src/appl/telnet/telnet/configure.in b/src/appl/telnet/telnet/configure.in index 9e9efafd0..74cc1c706 100644 --- a/src/appl/telnet/telnet/configure.in +++ b/src/appl/telnet/telnet/configure.in @@ -2,6 +2,7 @@ AC_INIT(telnet.c) CONFIG_RULES AC_PROG_INSTALL AC_FUNC_VFORK +AC_HEADER_STDARG AC_CHECK_HEADERS(string.h arpa/nameser.h unistd.h sys/select.h stdlib.h arpa/inet.h sys/filio.h curses.h term.h) AC_CHECK_LIB(termcap,main,AC_DEFINE(TERMCAP) LIBS="$LIBS -ltermcap",