diff options
author | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-03-04 21:58:05 +0000 |
---|---|---|
committer | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-03-04 21:58:05 +0000 |
commit | 36df3e4c370d5f45ba6f4c0356f2ecaae95aba0b (patch) | |
tree | 08fdb68eff59efb305bf5aaa2d4d9412dcccffad /gcc/ginclude | |
parent | 2e5d8ef90be3f784e081b6c3e80f0dc58a7a8c1f (diff) | |
download | gcc-36df3e4c370d5f45ba6f4c0356f2ecaae95aba0b.tar.gz |
*** empty log message ***
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@393 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ginclude')
-rw-r--r-- | gcc/ginclude/stdarg.h | 10 | ||||
-rw-r--r-- | gcc/ginclude/va-sparc.h | 12 |
2 files changed, 12 insertions, 10 deletions
diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h index 1382168ffd2..0dee079a2b7 100644 --- a/gcc/ginclude/stdarg.h +++ b/gcc/ginclude/stdarg.h @@ -22,6 +22,9 @@ #ifdef __mips__ #include "va-mips.h" #else +#ifdef __sparc__ +#include "va-sparc.h" +#else #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */ #undef _VA_LIST @@ -43,14 +46,8 @@ typedef char *va_list; #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 libgcc.a */ #define va_end(AP) @@ -59,6 +56,7 @@ void va_end (va_list); /* Defined in libgcc.a */ (AP += __va_rounded_size (TYPE), \ *((TYPE *) (AP - __va_rounded_size (TYPE)))) +#endif /* not sparc */ #endif /* not mips */ #endif /* not hp9000s800 */ #endif /* not i860 */ diff --git a/gcc/ginclude/va-sparc.h b/gcc/ginclude/va-sparc.h index 02ca023addf..02c6613d407 100644 --- a/gcc/ginclude/va-sparc.h +++ b/gcc/ginclude/va-sparc.h @@ -20,10 +20,14 @@ typedef char * __va___list; /* The ... causes current_function_varargs to be set in cc1. */ #define va_dcl int __builtin_va_alist; __va_ellipsis -/* The difference is to store the stack address in both components - instead of in AP itself. */ +#ifdef _STDARG_H +#define va_start(AP, LASTARG) \ + (__builtin_saveregs (), AP = ((char *) __builtin_next_arg ())) +#else #define va_start(AP) \ (__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist)) +#endif + #define va_end(pvar) #define __va_rounded_size(TYPE) \ @@ -43,6 +47,6 @@ __extension__ \ ({ TYPE __va_temp; \ ((__builtin_classify_type (__va_temp) >= 12) \ ? ((pvar) += __va_rounded_size (TYPE *), \ - **(TYPE **) (pvar) - __va_rounded_size (TYPE *)) \ - : ((pvar) += __va_rounded_size (TYPE), \ + **(TYPE **) ((pvar) - __va_rounded_size (TYPE *))) \ + : ((pvar) += __va_rounded_size (TYPE), \ *((TYPE *) ((pvar) - __va_rounded_size (TYPE)))));}) |