Use __builtin_next_arg(). Fixed PR 6862.

This commit is contained in:
mycroft 1999-01-22 14:14:32 +00:00
parent 56934caa9d
commit ec253b6315
6 changed files with 28 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdarg.h,v 1.3 1997/10/14 09:20:34 mark Exp $ */
/* $NetBSD: stdarg.h,v 1.4 1999/01/22 14:14:32 mycroft Exp $ */
/*
* Copyright (c) 1991, 1993
@ -35,16 +35,18 @@
* from: @(#)stdarg.h 8.1 (Berkeley) 6/10/93
*/
#ifndef _STDARG_H_
#define _STDARG_H_
#ifndef _ARM32_STDARG_H_
#define _ARM32_STDARG_H_
typedef char *va_list;
#include <machine/ansi.h>
#define __va_promote(type) \
(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
typedef _BSD_VA_LIST_ va_list;
#define __va_size(type) \
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
#define va_start(ap, last) \
(ap = ((char *)&(last) + __va_promote(last)))
((ap) = (va_list)__builtin_next_arg(last))
#ifdef _KERNEL
#define va_arg(ap, type) \
@ -57,4 +59,4 @@ typedef char *va_list;
#define va_end(ap)
#endif /* !_STDARG_H_ */
#endif /* !_ARM32_STDARG_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdarg.h,v 1.14 1998/09/26 19:21:19 christos Exp $ */
/* $NetBSD: stdarg.h,v 1.15 1999/01/22 14:14:32 mycroft Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -46,7 +46,7 @@ typedef _BSD_VA_LIST_ va_list;
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
#define va_start(ap, last) \
((ap) = (va_list)(void *)&(last) + __va_size(last))
((ap) = (va_list)__builtin_next_arg(last))
#define va_arg(ap, type) \
(*(type *)(void *)((ap) += __va_size(type), (ap) - __va_size(type)))

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdarg.h,v 1.15 1998/07/27 13:55:33 mycroft Exp $ */
/* $NetBSD: stdarg.h,v 1.16 1999/01/22 14:14:32 mycroft Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -46,13 +46,13 @@ typedef _BSD_VA_LIST_ va_list;
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
#define va_start(ap, last) \
((ap) = (va_list)&(last) + __va_size(last))
((ap) = (va_list)__builtin_next_arg(last))
#define va_arg(ap, type) \
(*(type *)((ap) += __va_size(type), \
(ap) - (sizeof(type) < sizeof(long) && \
sizeof(type) != __va_size(type) ? \
sizeof(type) : __va_size(type))))
(*(type *)(void *)((ap) += __va_size(type), \
(ap) - (sizeof(type) < sizeof(long) && \
sizeof(type) != __va_size(type) ? \
sizeof(type) : __va_size(type))))
#define va_end(ap)

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdarg.h,v 1.13 1998/09/11 16:46:32 jonathan Exp $ */
/* $NetBSD: stdarg.h,v 1.14 1999/01/22 14:14:32 mycroft Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -42,11 +42,11 @@
typedef _BSD_VA_LIST_ va_list;
#define __va_promote(type) \
(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
#define __va_size(type) \
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
#define va_start(ap, last) \
(ap = ((char *)&(last) + __va_promote(last)))
((ap) = (va_list)__builtin_next_arg(last))
#ifdef _KERNEL
#define va_arg(ap, type) \

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdarg.h,v 1.13 1998/07/27 13:55:34 mycroft Exp $ */
/* $NetBSD: stdarg.h,v 1.14 1999/01/22 14:14:32 mycroft Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -46,10 +46,10 @@ typedef _BSD_VA_LIST_ va_list;
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
#define va_start(ap, last) \
((ap) = (va_list)&(last) + __va_size(last))
((ap) = (va_list)__builtin_next_arg(last))
#define va_arg(ap, type) \
(*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
(*(type *)(void *)((ap) += __va_size(type), (ap) - __va_size(type)))
#define va_end(ap)

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdarg.h,v 1.9 1998/07/27 13:55:35 mycroft Exp $ */
/* $NetBSD: stdarg.h,v 1.10 1999/01/22 14:14:32 mycroft Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@ -46,10 +46,10 @@ typedef _BSD_VA_LIST_ va_list;
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
#define va_start(ap, last) \
((ap) = (va_list)&(last) + __va_size(last))
((ap) = (va_list)__builtin_next_arg(last))
#define va_arg(ap, type) \
(*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
(*(type *)(void *)((ap) += __va_size(type), (ap) - __va_size(type)))
#define va_end(ap)