Now uses only stdarg and no varargs. See #130079.

Side-effect: non-ANSI C compilers will probably no longer work (anyone
still uses MIPS compiler on DEcstation/Ultrix?)
This commit is contained in:
Stephane Bortzmeyer 2001-01-28 21:03:05 +00:00
parent 5db9b1c007
commit 87d83d3d9e
2 changed files with 14 additions and 30 deletions

View File

@ -28,10 +28,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifndef OPENSSL
/* OpenSSL includes stdarg :-( */
#include <varargs.h>
#endif
#include <stdarg.h>
#include <sys/time.h>
#include <errno.h>
#include <unistd.h>
@ -44,8 +41,6 @@
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <varargs.h>
#endif /* OpenSSL */
#ifndef FALSE
@ -120,9 +115,9 @@ char *server;
/* error.c */
void usage ();
void err_sys ();
void err_ret ();
void err_quit ();
void err_sys (char *str, ...);
void err_ret (char *str, ...);
void err_quit (char *str, ...);
char *sys_err_str ();
/* writen.c */
int writen ();

View File

@ -20,17 +20,12 @@ my_perror ()
/* VARARGS1 */
void
err_ret (va_alist)
va_dcl
err_ret (char *str, ...)
{
va_list args;
char *fmt;
va_start (args); /* TODO: use stdarg, otherwise, on *some*
platforms: "macro `va_start' used with just one arg" because OpenSSL
includes stdarg. */
fmt = va_arg (args, char *);
vfprintf (stderr, fmt, args);
va_start (args, str);
vfprintf (stderr, str, args);
va_end (args);
my_perror ();
@ -52,15 +47,12 @@ err_ret (va_alist)
/* VARARGS1 */
void
err_quit (va_alist)
va_dcl
err_quit (char *str, ...)
{
va_list args;
char *fmt;
va_start (args);
fmt = va_arg (args, char *);
vfprintf (stderr, fmt, args);
va_start (args, str);
vfprintf (stderr, str, args);
fputc ('\n', stderr);
va_end (args);
@ -79,15 +71,12 @@ err_quit (va_alist)
/* VARARGS1 */
void
err_sys (va_alist)
va_dcl
err_sys (char *str, ...)
{
va_list args;
char *fmt;
va_start (args);
fmt = va_arg (args, char *);
vfprintf (stderr, fmt, args);
va_start (args, str);
vfprintf (stderr, str, args);
va_end (args);
my_perror ();