ack/util/ceg/EM_parser/as_EM_pars/error.c

40 lines
556 B
C
Raw Normal View History

1987-11-20 11:12:07 +00:00
#include <system.h>
#if __STDC__
#include <stdarg.h>
#else
1988-09-09 11:32:59 +00:00
#include <varargs.h>
#endif
1987-11-20 11:12:07 +00:00
1988-09-09 11:25:43 +00:00
extern int nerrors;
#if __STDC__
/*VARARGS*/
error(char *fmt, ...)
{
va_list pvar;
va_start(pvar, fmt);
fprint( STDERR, "!! ERROR : ");
doprnt( STDERR, fmt, pvar);
fprint( STDERR, " !!\n");
va_end(pvar);
nerrors++;
}
#else
1988-09-09 11:32:59 +00:00
/*VARARGS*/
error(va_alist)
va_dcl
1987-11-20 11:12:07 +00:00
{
1988-09-09 11:32:59 +00:00
char *fmt;
va_list pvar;
va_start(pvar);
fmt = va_arg(pvar, char *);
1987-11-20 11:12:07 +00:00
fprint( STDERR, "!! ERROR : ");
1988-09-09 11:32:59 +00:00
doprnt( STDERR, fmt, pvar);
1987-11-20 11:12:07 +00:00
fprint( STDERR, " !!\n");
1988-09-09 11:32:59 +00:00
va_end(pvar);
1988-09-09 11:25:43 +00:00
nerrors++;
1987-11-20 11:12:07 +00:00
}
#endif