diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2021-08-15 00:34:05 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2021-08-15 00:34:05 -0400 |
| commit | 60cc83bf91bfc9bb02f6304b5d6c8234ba6d210f (patch) | |
| tree | fdc0be85a1ca35e34c3ae2c805fe9b718e3c1091 /gcc-1.40/gstdarg.h | |
| parent | dd8dfab51b832a654365ed00c06bf802ff628bfa (diff) | |
| download | linux-0.01-distro-60cc83bf91bfc9bb02f6304b5d6c8234ba6d210f.tar.gz linux-0.01-distro-60cc83bf91bfc9bb02f6304b5d6c8234ba6d210f.tar.bz2 linux-0.01-distro-60cc83bf91bfc9bb02f6304b5d6c8234ba6d210f.zip | |
Diffstat (limited to 'gcc-1.40/gstdarg.h')
| -rw-r--r-- | gcc-1.40/gstdarg.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc-1.40/gstdarg.h b/gcc-1.40/gstdarg.h new file mode 100644 index 0000000..bae4985 --- /dev/null +++ b/gcc-1.40/gstdarg.h @@ -0,0 +1,44 @@ +/* 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 + +/* 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 + +/* 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) + +#ifdef __mips__ +#define va_arg(AP, mode) ((mode *)(AP = \ + (char *) (sizeof(mode) > 4 ? ((int)AP + 2*8 - 1) & -8 \ + : ((int)AP + 2*4 - 1) & -4)))[-1] +#else /* not __mips__ */ +#define va_arg(AP, TYPE) \ + (*((TYPE *) (AP += __va_rounded_size (TYPE), \ + AP - (sizeof (TYPE) < 4 ? sizeof (TYPE) \ + : __va_rounded_size (TYPE))))) +#endif /* not __mips__ */ + +#endif /* _STDARG_H */ |
