From: Richard Stallman Date: Mon, 30 Nov 1992 23:06:23 +0000 (+0000) Subject: (va_end): #undef before the declaration. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0cd3c247a3b77a858b713e4da4271e4b9f6e31bb;p=gcc.git (va_end): #undef before the declaration. (va_arg): Alternative definition for big-endian machines. From-SVN: r2820 --- diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h index 4ee9bb9ae6c..2b360685559 100644 --- a/gcc/ginclude/stdarg.h +++ b/gcc/ginclude/stdarg.h @@ -62,14 +62,26 @@ typedef void *__gnuc_va_list; #define va_start(AP, LASTARG) \ (AP = ((__gnuc_va_list) __builtin_next_arg ())) +#undef va_end void va_end (__gnuc_va_list); /* Defined in libgcc.a */ #define va_end(AP) /* We cast to void * and then to TYPE * because this avoids a warning about increasing the alignment requirement. */ + +#if defined (__arm__) || defined (__i386__) || defined (__ns32000__) || defined (__vax__) +/* This is for little-endian machines; small args are padded upward. */ #define va_arg(AP, TYPE) \ (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) +#else /* big-endian */ +/* This is for big-endian machines; small args are padded downward. */ +#define va_arg(AP, TYPE) \ + (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ + *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < 4 \ + ? sizeof (TYPE) \ + : __va_rounded_size (TYPE)))))) +#endif /* big-endian */ #endif /* _STDARG_H */ #endif /* not alpha */