summaryrefslogtreecommitdiff
path: root/sys/arch/m68k/include/varargs.h
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-30 08:48:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-30 08:48:24 +0000
commitda10fa74772694cff97087eb39c83a311ba6eadc (patch)
treec2f7eb8915196cb758b2aabeb7ed60b0df6ffcd8 /sys/arch/m68k/include/varargs.h
parentb9aee3c44417b6bdbb038f048472d3b1f05aaa8c (diff)
from netbsd: support more gcc versions
Diffstat (limited to 'sys/arch/m68k/include/varargs.h')
-rw-r--r--sys/arch/m68k/include/varargs.h32
1 files changed, 11 insertions, 21 deletions
diff --git a/sys/arch/m68k/include/varargs.h b/sys/arch/m68k/include/varargs.h
index d3a160453c0..925c1d21278 100644
--- a/sys/arch/m68k/include/varargs.h
+++ b/sys/arch/m68k/include/varargs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: varargs.h,v 1.10 1995/03/26 17:08:41 briggs Exp $ */
+/* $NetBSD: varargs.h,v 1.14 1995/12/26 01:16:28 mycroft Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -43,29 +43,19 @@
#ifndef _M68K_VARARGS_H_
#define _M68K_VARARGS_H_
-#include <machine/ansi.h>
+#include <machine/stdarg.h>
-typedef _BSD_VA_LIST_ va_list;
-
-#define va_dcl int va_alist; ...
-
-#define __va_promote(type) \
- (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
-
-#define va_start(ap) \
- ap = (char *)&va_alist
-
-#ifdef _KERNEL
-#define va_arg(ap, type) \
- ((type *)(ap += sizeof(type)))[-1]
+#if __GNUC__ == 1
+#define __va_ellipsis
#else
-#define va_arg(ap, type) \
- ((type *)(ap += __va_promote(type), \
- ap - (sizeof(type) < sizeof(int) && \
- sizeof(type) != __va_promote(type) ? \
- sizeof(type) : __va_promote(type))))[0]
+#define __va_ellipsis ...
#endif
-#define va_end(ap) ((void) 0)
+#define va_alist __builtin_va_alist
+#define va_dcl long __builtin_va_alist; __va_ellipsis
+
+#undef va_start
+#define va_start(ap) \
+ ((ap) = (va_list)&__builtin_va_alist)
#endif /* !_M68K_VARARGS_H_ */