summaryrefslogtreecommitdiffstats
path: root/sys/alpha
diff options
context:
space:
mode:
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/include/ansi.h4
-rw-r--r--sys/alpha/include/stdarg.h25
-rw-r--r--sys/alpha/include/varargs.h23
3 files changed, 42 insertions, 10 deletions
diff --git a/sys/alpha/include/ansi.h b/sys/alpha/include/ansi.h
index 3c4b58a..87966c3 100644
--- a/sys/alpha/include/ansi.h
+++ b/sys/alpha/include/ansi.h
@@ -72,8 +72,8 @@
#define _BSD_OFF_T_ long /* file offset */
#define _BSD_PID_T_ int /* process [group] */
-#if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 95)
-#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
+#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
#else
typedef struct {
char *__base;
diff --git a/sys/alpha/include/stdarg.h b/sys/alpha/include/stdarg.h
index 2003b7b..1632add 100644
--- a/sys/alpha/include/stdarg.h
+++ b/sys/alpha/include/stdarg.h
@@ -1,7 +1,5 @@
-/* $FreeBSD$ */
-/* From: NetBSD: stdarg.h,v 1.7 1997/04/06 08:47:44 cgd Exp */
-
/*-
+ * Copyright (c) 2002 David E. O'Brien. All rights reserved.
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -34,6 +32,8 @@
* SUCH DAMAGE.
*
* @(#)stdarg.h 8.1 (Berkeley) 6/10/93
+ * $NetBSD: stdarg.h,v 1.7 1997/04/06 08:47:44 cgd Exp $
+ * $FreeBSD$
*/
#ifndef _ALPHA_STDARG_H_
@@ -41,13 +41,26 @@
#include <machine/ansi.h>
+typedef _BSD_VA_LIST_ va_list;
+
+#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+
+#define va_start(ap, last) \
+ __builtin_stdarg_start((ap), (last))
+
+#define va_arg(ap, type) \
+ __builtin_va_arg((ap), type)
+
+#define va_end(ap) \
+ __builtin_va_end(ap)
+
+#else /* ! __GNUC__ post GCC 2.95 */
+
#ifdef __lint__
#define __builtin_saveregs() (0)
#define __builtin_classify_type(t) (0)
#endif
-typedef _BSD_VA_LIST_ va_list;
-
#define __va_size(type) \
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
@@ -65,4 +78,6 @@ typedef _BSD_VA_LIST_ va_list;
#define va_end(ap) ((void)0)
+#endif /* __GNUC__ post GCC 2.95 */
+
#endif /* !_ALPHA_STDARG_H_ */
diff --git a/sys/alpha/include/varargs.h b/sys/alpha/include/varargs.h
index d355ec8..bcf9ed3 100644
--- a/sys/alpha/include/varargs.h
+++ b/sys/alpha/include/varargs.h
@@ -1,7 +1,5 @@
-/* $FreeBSD$ */
-/* From: NetBSD: varargs.h,v 1.7 1997/04/06 08:47:46 cgd Exp */
-
/*-
+ * Copyright (c) 2002 David E. O'Brien. All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
@@ -39,11 +37,28 @@
* SUCH DAMAGE.
*
* @(#)varargs.h 8.2 (Berkeley) 3/22/94
+ * $NetBSD: varargs.h,v 1.7 1997/04/06 08:47:46 cgd Exp $
+ * $FreeBSD$
*/
#ifndef _ALPHA_VARARGS_H_
#define _ALPHA_VARARGS_H_
+#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+
+#include <machine/ansi.h>
+
+typedef _BSD_VA_LIST_ va_list;
+typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
+
+#define va_alist __builtin_va_alist
+#define va_dcl __builtin_va_alist_t __builtin_va_alist; ...
+#define va_start(ap) __builtin_varargs_start(ap)
+#define va_arg(ap, type) __builtin_va_arg((ap), type)
+#define va_end(ap) __builtin_va_end(ap)
+
+#else /* ! __GNUC__ post GCC 2.95 */
+
#include <machine/stdarg.h>
#if __GNUC__ == 1
@@ -59,4 +74,6 @@
#define va_start(ap) \
((ap) = *(va_list *)__builtin_saveregs(), (ap).__pad = 0)
+#endif /* __GNUC__ post GCC 2.95 */
+
#endif /* !_ALPHA_VARARGS_H_ */
OpenPOWER on IntegriCloud