diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2009-11-30 00:24:35 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2009-11-30 00:24:35 +0100 |
commit | 76e00450db45bfc4f2766c67bc861228c1023a75 (patch) | |
tree | 30417c3c35253af1837f96c416d7a6813d2574ce | |
parent | 5410b66caae0a92ca3c3fb2f2f26e38e5eda402b (diff) |
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.
-rw-r--r-- | i386/include/mach/sa/stdarg.h | 12 |
1 files changed, 12 insertions, 0 deletions
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_ */ |