summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1992-03-04 13:58:05 -0800
committerJim Wilson <wilson@gcc.gnu.org>1992-03-04 13:58:05 -0800
commit5840cf94b92bb1742326722082c0b4782160b96f (patch)
tree08fdb68eff59efb305bf5aaa2d4d9412dcccffad
parent724d9f3ddea0faa286ac0fa464625ae77d2e807a (diff)
downloadgcc-5840cf94b92bb1742326722082c0b4782160b96f.tar.gz
*** empty log message ***
From-SVN: r393
-rw-r--r--gcc/ginclude/stdarg.h10
-rw-r--r--gcc/ginclude/va-sparc.h12
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)))));})