aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64/include/stdarg.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/stdarg.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/stdarg.h')
-rw-r--r--sys/sparc64/include/stdarg.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/sparc64/include/stdarg.h b/sys/sparc64/include/stdarg.h
index 2f0fd8cadfea..c126af09fda0 100644
--- a/sys/sparc64/include/stdarg.h
+++ b/sys/sparc64/include/stdarg.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.
*
@@ -32,8 +33,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)stdarg.h 8.2 (Berkeley) 9/27/93
- * from: NetBSD: stdarg.h,v 1.11 2000/07/23 21:36:56 mycroft Exp
+ * @(#)stdarg.h 8.2 (Berkeley) 9/27/93
+ * $NetBSD: stdarg.h,v 1.11 2000/07/23 21:36:56 mycroft Exp $
* $FreeBSD$
*/
@@ -44,6 +45,19 @@
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 */
+
#define va_start(ap, last) \
(__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs())
@@ -69,4 +83,6 @@ typedef _BSD_VA_LIST_ va_list;
(sizeof(type) <= 16 ? __va_arg16(ap, type) : \
*__va_arg8(ap, type *)))))
+#endif /* __GNUC__ post GCC 2.95 */
+
#endif /* !_MACHINE_STDARG_H_ */