summaryrefslogtreecommitdiffstats
path: root/sys/alpha/include/varargs.h
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-05-10 02:02:54 +0000
committerobrien <obrien@FreeBSD.org>2002-05-10 02:02:54 +0000
commit707b0b13a68bb4f18608bc2b61b968b1d11f7f4f (patch)
treeb2c2da53a08934116f97d9b8df58bf01fd5f8452 /sys/alpha/include/varargs.h
parent4267f26cd12834761ab9e3002ec3be631a3557c6 (diff)
downloadFreeBSD-src-707b0b13a68bb4f18608bc2b61b968b1d11f7f4f.zip
FreeBSD-src-707b0b13a68bb4f18608bc2b61b968b1d11f7f4f.tar.gz
Gcc 3.1 varargs support.
Diffstat (limited to 'sys/alpha/include/varargs.h')
-rw-r--r--sys/alpha/include/varargs.h23
1 files changed, 20 insertions, 3 deletions
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