diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2006-01-06 18:53:07 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2006-01-06 18:53:07 +0000 |
commit | 4f6f4abee953638d3409775c050227c9537c9e8c (patch) | |
tree | 38d3a984a5a051627704f25d9151930244be39c5 /sys/arch/amd64 | |
parent | a835e97a88caf4a2d77874683640dd0e6c0225d1 (diff) |
Adapt things to use __type_t instead of _BSD_TYPE_T_
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/include/stdarg.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/sys/arch/amd64/include/stdarg.h b/sys/arch/amd64/include/stdarg.h index 370b624166f..feeb97970a7 100644 --- a/sys/arch/amd64/include/stdarg.h +++ b/sys/arch/amd64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.3 2005/12/14 21:46:30 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.4 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.2 2003/04/28 23:16:17 bjh21 Exp $ */ /*- @@ -36,17 +36,28 @@ #define _AMD64_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> /* for __va_list */ -typedef _BSD_VA_LIST_ va_list; +/* + * NOTE: this file is only used by lint and non-GNU compilers + */ + +typedef __va_list va_list; + +#define __va_size(type) \ + (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) -#define va_start(ap, last) __builtin_stdarg_start((ap), (last)) -#define va_arg __builtin_va_arg -#define va_end(ap) __builtin_va_end(ap) -#define __va_copy(dest, src) __builtin_va_copy((dest), (src)) +#define va_start(ap, last) \ + ((ap) = (va_list)&(last) + __va_size(last)) + +#define va_arg(ap, type) \ + (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) #if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) __va_copy((dest), (src)) +#define va_copy(dest, src) \ + ((dest) = (src)) #endif +#define va_end(ap) + #endif /* !_AMD64_STDARG_H_ */ |