use stdarg when compiling with ANSI C compiler
This commit is contained in:
@@ -31,9 +31,13 @@ Something wrong here! Only one of FM2, FPC, or FCC must be defined
|
||||
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <varargs.h>
|
||||
#include <stdio.h>
|
||||
#include <em_path.h>
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
Version producing ACK .o files in one pass.
|
||||
@@ -178,7 +182,11 @@ int v_flag = 0;
|
||||
int O_flag = 0;
|
||||
int ansi_c = 0;
|
||||
|
||||
#if __STDC__
|
||||
char *mkstr(char *, ...);
|
||||
#else
|
||||
char *mkstr();
|
||||
#endif
|
||||
char *malloc();
|
||||
char *alloc();
|
||||
char *extension();
|
||||
@@ -669,7 +677,32 @@ concat(al1, al2)
|
||||
*p++ = *q++;
|
||||
}
|
||||
}
|
||||
#if __STDC__
|
||||
/*VARARGS*/
|
||||
char *
|
||||
mkstr(char *dst, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, dst);
|
||||
{
|
||||
register char *p;
|
||||
register char *q;
|
||||
|
||||
q = dst;
|
||||
p = va_arg(ap, char *);
|
||||
|
||||
while (p) {
|
||||
while (*q++ = *p++);
|
||||
q--;
|
||||
p = va_arg(ap, char *);
|
||||
}
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
return dst;
|
||||
}
|
||||
#else
|
||||
/*VARARGS*/
|
||||
char *
|
||||
mkstr(va_alist)
|
||||
@@ -696,7 +729,7 @@ mkstr(va_alist)
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
#endif
|
||||
basename(str, dst)
|
||||
char *str;
|
||||
register char *dst;
|
||||
|
||||
Reference in New Issue
Block a user