[5766] in Athena Bugs
Re:
daemon@ATHENA.MIT.EDU (Richard Basch)
Sat Aug 18 20:51:25 1990
Date: Sat, 18 Aug 90 20:51:02 -0400
To: jfc@MIT.EDU
Cc: bugs@ATHENA.MIT.EDU
In-Reply-To: bugs[5765]
From: Richard Basch <probe@MIT.EDU>
[5765] daemon@ATHENA.MIT.EDU Athena Bugs 08/18/90 17:21 (20 lines)
Subject: <stdarg.h>
To: bugs@ATHENA.MIT.EDU
Date: Sat, 18 Aug 90 17:21:38 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>
The following should be placed in /usr/include/stdarg.h on the RT.
#ifndef _STDARG_H
#define _STDARG_H
#ifndef __HIGHC__
#error stdarg requires High C
#endif
typedef int *va_list;
#define va_start(ap, arg) ap = ((int *)&arg) + ((sizeof(arg) + 3) / 4)
#define va_end(ap)
#define va_arg(ap, type) ((type *)(ap += (sizeof(type)+3)/4))[-1]
#endif /* _STDARG_H */
--[5765]--
Wouldn't it be better to install it on both and change:
#ifndef __HIGHC__
to:
#ifndef __STDC__
and change the error statement to be something like:
#error stdarg requires an ANSI C compiler
This way, if we ever do get our header files ANSI compliant, GCC users
don't need to be using a different include file path. Also, what's to
say there won't be other ANSI compliant compilers (not that I expect we
will be using others in the near future).
-Richard