From 76e00450db45bfc4f2766c67bc861228c1023a75 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 30 Nov 2009 00:24:35 +0100 Subject: Use gcc builtins for stdarg.h when available * i386/include/mach/sa/stdarg.h [__GNUC__ >= 3] (va_list): Typedef to __builtin_va_list. (va_start): define to __builtin_va_start. (va_end): define to __builtin_va_end. (va_arg): define to __builtin_va_arg. --- i386/include/mach/sa/stdarg.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'i386/include/mach/sa/stdarg.h') diff --git a/i386/include/mach/sa/stdarg.h b/i386/include/mach/sa/stdarg.h index 01b2dc7..ba0f78a 100644 --- a/i386/include/mach/sa/stdarg.h +++ b/i386/include/mach/sa/stdarg.h @@ -29,6 +29,16 @@ #ifndef _MACH_SA_STDARG_H_ #define _MACH_SA_STDARG_H_ +#if __GNUC__ >= 3 + +typedef __builtin_va_list va_list; + +#define va_start(v,l) __builtin_va_start(v,l) +#define va_end(v) __builtin_va_end(v) +#define va_arg(v,l) __builtin_va_arg(v,l) + +#else + #define __va_size(type) ((sizeof(type)+3) & ~0x3) #ifndef _VA_LIST_ @@ -43,4 +53,6 @@ typedef char *va_list; ((pvar) += __va_size(type), \ *((type *)((pvar) - __va_size(type)))) +#endif + #endif /* _MACH_SA_STDARG_H_ */ -- cgit v1.2.3