diff options
author | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-11-30 23:06:23 +0000 |
---|---|---|
committer | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-11-30 23:06:23 +0000 |
commit | 39ae866879b90056651a71ee3e82e8b32604cd3e (patch) | |
tree | d8113c200c0c3ea1ea5d2b1d7ab462febfaabc2c /gcc/ginclude/stdarg.h | |
parent | 121541acae1ea43477d415aa33313a1fb3ad2531 (diff) | |
download | gcc-39ae866879b90056651a71ee3e82e8b32604cd3e.tar.gz |
(va_end): #undef before the declaration.
(va_arg): Alternative definition for big-endian machines.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2820 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ginclude/stdarg.h')
-rw-r--r-- | gcc/ginclude/stdarg.h | 12 |
1 files changed, 12 insertions, 0 deletions
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 */ |