* configure.in: Add AC_HEADER_STDARG
authorEzra Peisach <epeisach@mit.edu>
Sun, 8 Jul 2001 12:34:16 +0000 (12:34 +0000)
committerEzra Peisach <epeisach@mit.edu>
Sun, 8 Jul 2001 12:34:16 +0000 (12:34 +0000)
        * commands.c (call): Rewrite to use varargs/stdarg interface.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13589 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/telnet/telnet/ChangeLog
src/appl/telnet/telnet/commands.c
src/appl/telnet/telnet/configure.in

index 77e8e9b62be7b3da4f13aae664ce3a806a9d45f9..e1f6d8c47a129a94421f342537b56ab85cc18752 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-08  Ezra Peisach  <epeisach@mit.edu>
+
+       * configure.in: Add AC_HEADER_STDARG.
+
+       * commands.c (call): Rewrite to use varargs/stdarg interface.
+
 2001-07-06  Ezra Peisach  <epeisach@mit.edu>
 
        * configure.in: Check if prototype needed for herror().
index cab1613a785d85270213f035b0f69a50bee9701c..4ac736e4e3caaf6f49a7863d4aa083eea30084aa 100644 (file)
 #include <netdb.h>
 #include <ctype.h>
 #include <pwd.h>
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#endif
 #include <errno.h>
 #ifdef HAVE_VFORK_H
 #include <vfork.h>
@@ -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) {
        ;
     }
index 9e9efafd05b752fad39d2cd5cd43a926895ed69e..74cc1c706fa8736c1dd32a7ad1b7069fe3967baf 100644 (file)
@@ -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",