From 0509996f7f7fadcf69fd6fb5f2637c5c72efac99 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 17 Aug 1995 15:01:56 +0000 Subject: [PATCH] use stdarg when compiling with ANSI C compiler --- lang/cem/lint/lpass2/report.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lang/cem/lint/lpass2/report.c b/lang/cem/lint/lpass2/report.c index 9862b3b92..779b63cae 100644 --- a/lang/cem/lint/lpass2/report.c +++ b/lang/cem/lint/lpass2/report.c @@ -4,7 +4,12 @@ */ /* $Id$ */ +#if __STDC__ +#include +extern panic(char *, ...); +#else #include +#endif #include #include "private.h" @@ -19,6 +24,15 @@ extern int LineNr; PRIVATE rep_loc(); +#if __STDC__ +/* VARARGS */ +report(char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + { +#else /* VARARGS */ report(va_alist) va_dcl @@ -28,6 +42,7 @@ report(va_alist) va_start(ap); { char *fmt = va_arg(ap, char*); +#endif register char *f = fmt; register char fc; @@ -108,6 +123,23 @@ rep_loc(id) } } +#if __STDC__ +/* VARARGS */ +panic(char *fmt, ...) /* fmt, args */ +{ + va_list ap; + + va_start(ap, fmt); + { + fprint(ERROUT, "PANIC, lint, pass2: line %d: ", LineNr); + doprnt(ERROUT, fmt, ap); + fprint(ERROUT, "\n"); + } + va_end(ap); + + exit(1); +} +#else /* VARARGS */ panic(va_alist) /* fmt, args */ va_dcl @@ -126,4 +158,4 @@ panic(va_alist) /* fmt, args */ exit(1); } - +#endif