diff options
author | Richard Stallman <rms@gnu.org> | 1991-12-15 19:56:55 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1991-12-15 19:56:55 +0000 |
commit | 0dbbbb09d3c7c393dc1b7774fee3caa95d9b3cb1 (patch) | |
tree | 68f0b9cf3aa48e6fc0140296571bb4f0b67e67da | |
parent | df2632b0c5812a9cc45d9a1030e82e1ba68f36cd (diff) | |
download | gcc-0dbbbb09d3c7c393dc1b7774fee3caa95d9b3cb1.zip gcc-0dbbbb09d3c7c393dc1b7774fee3caa95d9b3cb1.tar.gz gcc-0dbbbb09d3c7c393dc1b7774fee3caa95d9b3cb1.tar.bz2 |
Initial revision
From-SVN: r119
-rw-r--r-- | gcc/ginclude/stdarg.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h new file mode 100644 index 0000000..0ea8d92 --- /dev/null +++ b/gcc/ginclude/stdarg.h @@ -0,0 +1,46 @@ +/* stdarg.h for GNU. + Note that the type used in va_arg is supposed to match the + actual type **after default promotions**. + Thus, va_arg (..., short) is not valid. */ + +#ifndef _STDARG_H +#define _STDARG_H + +#ifdef __m88k__ +#include "va-m88k.h" +#else +#ifdef __i860__ +#include "va-i860.h" +#else + +/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */ +#ifndef _VA_LIST_ +#define _VA_LIST_ +typedef char *va_list; +#endif /* _VA_LIST_ */ + +/* Amount of space required in an argument list for an arg of type TYPE. + TYPE may alternatively be an expression whose type is used. */ + +#define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) + +#ifndef __sparc__ +#define va_start(AP, LASTARG) \ + (AP = ((char *) __builtin_next_arg ())) +#else +#define va_start(AP, LASTARG) \ + (__builtin_saveregs (), \ + AP = ((char *) __builtin_next_arg ())) +#endif + +void va_end (va_list); /* Defined in gnulib */ +#define va_end(AP) + +#define va_arg(AP, TYPE) \ + (AP += __va_rounded_size (TYPE), \ + *((TYPE *) (AP - __va_rounded_size (TYPE)))) + +#endif /* not i860 */ +#endif /* not m88k */ +#endif /* _STDARG_H */ |