use varargs

This commit is contained in:
ceriel 1988-09-09 11:32:59 +00:00
parent ec5cff92d8
commit 2d98c32cb2
2 changed files with 22 additions and 10 deletions

View file

@ -1,13 +1,20 @@
#include <system.h>
#include <varargs.h>
extern int nerrors;
error( fmt, argv)
char *fmt;
int argv;
/*VARARGS*/
error(va_alist)
va_dcl
{
char *fmt;
va_list pvar;
va_start(pvar);
fmt = va_arg(pvar, char *);
fprint( STDERR, "!! ERROR : ");
doprnt( STDERR, fmt, &argv);
doprnt( STDERR, fmt, pvar);
fprint( STDERR, " !!\n");
va_end(pvar);
nerrors++;
}

View file

@ -1,5 +1,6 @@
#include <ctype.h>
#include <system.h>
#include <varargs.h>
#define CODE_EXPANDER
#include "em.h"
@ -98,15 +99,19 @@ int seg;
}
}
out( fmt, argv)
char *fmt;
int argv;
/*VARARGS*/
out(va_alist)
va_dcl
{
doprnt( outfile, fmt, &argv);
va_list pvar;
char *fmt;
va_start(pvar);
fmt = va_arg(pvar, char *);
doprnt( outfile, fmt, pvar);
va_end(pvar);
}
char *suffix( str, suf)
char *str, *suf;
{