diff --git a/sys/arch/arm32/include/stdarg.h b/sys/arch/arm32/include/stdarg.h index fbfbaa05f34f..d03cb0b516d2 100644 --- a/sys/arch/arm32/include/stdarg.h +++ b/sys/arch/arm32/include/stdarg.h @@ -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 -#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_ */ diff --git a/sys/arch/i386/include/stdarg.h b/sys/arch/i386/include/stdarg.h index 436efc29c802..0fdbc07807fb 100644 --- a/sys/arch/i386/include/stdarg.h +++ b/sys/arch/i386/include/stdarg.h @@ -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))) diff --git a/sys/arch/m68k/include/stdarg.h b/sys/arch/m68k/include/stdarg.h index 219d87c72d3f..d06a673b0d67 100644 --- a/sys/arch/m68k/include/stdarg.h +++ b/sys/arch/m68k/include/stdarg.h @@ -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) diff --git a/sys/arch/mips/include/stdarg.h b/sys/arch/mips/include/stdarg.h index 331cdb784fe4..c10e0323f0d5 100644 --- a/sys/arch/mips/include/stdarg.h +++ b/sys/arch/mips/include/stdarg.h @@ -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) \ diff --git a/sys/arch/pc532/include/stdarg.h b/sys/arch/pc532/include/stdarg.h index a1bc5455450b..d6a0b82cfcd9 100644 --- a/sys/arch/pc532/include/stdarg.h +++ b/sys/arch/pc532/include/stdarg.h @@ -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) diff --git a/sys/arch/vax/include/stdarg.h b/sys/arch/vax/include/stdarg.h index 1fab8afa5b61..b576b97e5f6d 100644 --- a/sys/arch/vax/include/stdarg.h +++ b/sys/arch/vax/include/stdarg.h @@ -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)