aboutsummaryrefslogtreecommitdiff
path: root/gcc-1.40/gvarargs.h
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2021-08-15 00:34:05 -0400
committerAndrew Lee <alee14498@protonmail.com>2021-08-15 00:34:05 -0400
commit60cc83bf91bfc9bb02f6304b5d6c8234ba6d210f (patch)
treefdc0be85a1ca35e34c3ae2c805fe9b718e3c1091 /gcc-1.40/gvarargs.h
parentdd8dfab51b832a654365ed00c06bf802ff628bfa (diff)
downloadlinux-0.01-distro-master.tar.gz
linux-0.01-distro-master.tar.bz2
linux-0.01-distro-master.zip
Added gccHEADmaster
Diffstat (limited to 'gcc-1.40/gvarargs.h')
-rw-r--r--gcc-1.40/gvarargs.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/gcc-1.40/gvarargs.h b/gcc-1.40/gvarargs.h
new file mode 100644
index 0000000..dc9c4ef
--- /dev/null
+++ b/gcc-1.40/gvarargs.h
@@ -0,0 +1,68 @@
+#ifndef __GNUC__
+/* Use the system's macros with the system's compiler. */
+#include <varargs.h>
+#else
+/* Record that varargs.h is defined; this turns off stdarg.h. */
+
+#ifndef _VARARGS_H
+#define _VARARGS_H
+
+#ifdef __sparc__
+#include "va-sparc.h"
+#else
+#ifdef __spur__
+#include "va-spur.h"
+#else
+#ifdef __mips__
+#include "va-mips.h"
+#else
+#ifdef __i860__
+#include "va-i860.h"
+#else
+#ifdef __pyr__
+#include "va-pyr.h"
+#else
+
+#ifdef __NeXT__
+
+/* On Next, erase any vestiges of stdarg.h. */
+
+#undef va_alist
+#undef va_dcl
+#undef va_list
+#undef va_start
+#undef va_end
+#undef __va_rounded_size
+#undef va_arg
+#endif /* __NeXT__ */
+
+/* These macros implement traditional (non-ANSI) varargs
+ for GNU C. */
+
+#define va_alist __builtin_va_alist
+#define va_dcl int __builtin_va_alist;
+#define va_list char *
+
+#ifdef __sparc__
+#define va_start(AP) \
+ (__builtin_saveregs (), \
+ AP = ((void *) &__builtin_va_alist))
+#else
+#define va_start(AP) AP=(char *) &__builtin_va_alist
+#endif
+#define va_end(AP)
+
+#define __va_rounded_size(TYPE) \
+ (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
+
+#define va_arg(AP, TYPE) \
+ (*((TYPE *) (AP += __va_rounded_size (TYPE), \
+ AP - __va_rounded_size (TYPE))))
+
+#endif /* not pyr */
+#endif /* not i860 */
+#endif /* not mips */
+#endif /* not spur */
+#endif /* not sparc */
+#endif /* not _VARARGS_H */
+#endif /* __GNUC__ */