aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64/include/varargs.h
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2002-05-10 02:02:54 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2002-05-10 02:02:54 +0000
commitfc336fdfbbe126c0a916e3e024c63632d2c97ec0 (patch)
treeb2c2da53a08934116f97d9b8df58bf01fd5f8452 /sys/sparc64/include/varargs.h
parentb0b7c2164ccd89c2c361b8b1c43a1143f1d0afa0 (diff)
downloadsrc-fc336fdfbbe126c0a916e3e024c63632d2c97ec0.tar.gz
src-fc336fdfbbe126c0a916e3e024c63632d2c97ec0.zip
Gcc 3.1 varargs support.
Notes
Notes: svn path=/head/; revision=96317
Diffstat (limited to 'sys/sparc64/include/varargs.h')
-rw-r--r--sys/sparc64/include/varargs.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/sparc64/include/varargs.h b/sys/sparc64/include/varargs.h
index 5f8fb7d41aeb..dd7e3a37819e 100644
--- a/sys/sparc64/include/varargs.h
+++ b/sys/sparc64/include/varargs.h
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2002 David E. O'Brien. All rights reserved.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
@@ -44,10 +45,25 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)varargs.h 8.3 (Berkeley) 3/22/94
+ * @(#)varargs.h 8.3 (Berkeley) 3/22/94
* $FreeBSD$
*/
+#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 */
+
#ifndef _MACHINE_VARARGS_H_
#define _MACHINE_VARARGS_H_
@@ -66,4 +82,6 @@
#define va_start(ap) \
((ap) = (va_list)__builtin_saveregs())
+#endif /* __GNUC__ post GCC 2.95 */
+
#endif /* !_MACHINE_VARARGS_H_ */