aboutsummaryrefslogtreecommitdiff
path: root/gcc/ginclude
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1991-09-12 22:23:09 +0000
committerRichard Stallman <rms@gnu.org>1991-09-12 22:23:09 +0000
commitf3db20a31d374204eef0a0c9bc1f7ca54dc585ea (patch)
tree3ff0959ff7e425e08d11ce09605a8a8cdbadf06a /gcc/ginclude
parent8ad117ff197ba8fdd9e12fc01c830d7abdfd434d (diff)
downloadgcc-f3db20a31d374204eef0a0c9bc1f7ca54dc585ea.zip
gcc-f3db20a31d374204eef0a0c9bc1f7ca54dc585ea.tar.gz
gcc-f3db20a31d374204eef0a0c9bc1f7ca54dc585ea.tar.bz2
Initial revision
From-SVN: r40
Diffstat (limited to 'gcc/ginclude')
-rw-r--r--gcc/ginclude/va-sparc.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/ginclude/va-sparc.h b/gcc/ginclude/va-sparc.h
new file mode 100644
index 0000000..f60f1e5
--- /dev/null
+++ b/gcc/ginclude/va-sparc.h
@@ -0,0 +1,42 @@
+/* This is just like the default gvarargs.h
+ except for differences decribed below. */
+
+/* Make this a macro rather than a typedef, so we can undef any other defn. */
+#define va_list __va___list
+/* This has to be a char * to be compatible with Sun.
+ i.e., we have to pass a `va_list' to vsprintf. */
+typedef char * __va___list;
+
+/* In GCC version 2, we want an ellipsis at the end of the declaration
+ of the argument list. GCC version 1 can't parse it. */
+
+#if __GNUC__ > 1
+#define __va_ellipsis ...
+#else
+#define __va_ellipsis
+#endif
+
+#define va_alist __builtin_va_alist
+/* 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. */
+#define va_start(AP) \
+ (__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist))
+#define va_end(pvar)
+
+#define __va_rounded_size(TYPE) \
+ (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
+
+/* RECORD_TYPE args passed using the C calling convention are
+ passed by invisible reference. ??? RECORD_TYPE args passed
+ in the stack are made to be word-aligned; for an aggregate that is
+ not word-aligned, we advance the pointer to the first non-reg slot. */
+#define va_arg(pvar,TYPE) \
+({ 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)))));})