ORCA-C/ORCACDefs/stdarg.h
Stephen Heumann 463da80902 Small tweaks to <stdarg.h>.
*Use a typedef rather than a macro definition for va_list. (The C standards specify that va_list is a type, although this would make a practical difference only if someone #undef'd it.)

*Don't include a semicolon in va_start(), so it expands to an expression rather than a statement. This could make a difference in a construct like "if (...) va_start(...); else ...".
2018-08-28 18:58:27 -05:00

35 lines
796 B
C

/****************************************************************
*
* stdarg.h - variable length parameter list handling
*
* February 1989
* Mike Westerfield
*
* Copyright 1989
* Byte Works, Inc.
*
*****************************************************************
*
* Modified July 1994
*
* Thanks to Doug Gwyn for the new va_start & va_arg declarations.
*
****************************************************************/
#ifndef __stdarg__
#define __stdarg__
#ifndef __va_list__
#define __va_list__
typedef char *__va_list[2];
#endif
typedef __va_list va_list;
#define va_end(a) __va_end(a)
#define va_start(ap,LastFixedParm) ((void) ((ap)[0] = (ap)[1] = (char *) (&LastFixedParm + 1)))
#define va_arg(ap,type) ((type *)((ap)[0] += sizeof(type)))[-1]
void __va_end(va_list);
#endif