From 0b058e3cbdc5865f37c8b8d7147e56a97dd29c52 Mon Sep 17 00:00:00 2001 From: Mike Barcroft Date: Sun, 6 Oct 2002 22:01:07 +0000 Subject: o Add conditionals to allow va_list to be defined in other headers. o Standardize on _MACHINE_STDARG_H_ to allow multiple header includes. o Restrict the definition of va_copy() to C99 environments. --- sys/i386/include/stdarg.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'sys/i386/include/stdarg.h') diff --git a/sys/i386/include/stdarg.h b/sys/i386/include/stdarg.h index 3ce2f376b387..246a991f814d 100644 --- a/sys/i386/include/stdarg.h +++ b/sys/i386/include/stdarg.h @@ -35,12 +35,16 @@ * $FreeBSD$ */ -#ifndef _STDARG_H_ -#define _STDARG_H_ +#ifndef _MACHINE_STDARG_H_ +#define _MACHINE_STDARG_H_ +#include #include -typedef __va_list va_list; +#ifndef _VA_LIST_DECLARED +#define _VA_LIST_DECLARED +typedef __va_list va_list; +#endif #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) @@ -50,8 +54,10 @@ typedef __va_list va_list; #define va_arg(ap, type) \ __builtin_va_arg((ap), type) +#if __ISO_C_VISIBLE >= 1999 #define va_copy(dest, src) \ __builtin_va_copy((dest), (src)) +#endif #define va_end(ap) \ __builtin_va_end(ap) @@ -77,4 +83,4 @@ typedef __va_list va_list; #endif /* __GNUC__ post GCC 2.95 */ -#endif /* !_STDARG_H_ */ +#endif /* !_MACHINE_STDARG_H_ */ -- cgit v1.2.3