1987-11-20 11:12:07 +00:00
|
|
|
#include <system.h>
|
1995-08-17 14:36:05 +00:00
|
|
|
#if __STDC__
|
|
|
|
#include <stdarg.h>
|
|
|
|
#else
|
1988-09-09 11:32:59 +00:00
|
|
|
#include <varargs.h>
|
1995-08-17 14:36:05 +00:00
|
|
|
#endif
|
1987-11-20 11:12:07 +00:00
|
|
|
|
1988-09-09 11:25:43 +00:00
|
|
|
extern int nerrors;
|
|
|
|
|
1995-08-17 14:36:05 +00:00
|
|
|
#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
|
|
|
}
|
1995-08-17 14:36:05 +00:00
|
|
|
#endif
|