From 3900b235e06af99f46714eb7950cd3fcc3b11c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gl=C3=B6ckner?= Date: Sun, 30 Mar 2014 00:08:05 +0100 Subject: [PATCH] x86_64: pass va_list as pointer The ABI requires that va_list is passed as a pointer although its contents is a kept in a structure. Therefore make it a single element array. --- include/stdarg.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/stdarg.h b/include/stdarg.h index b6a30f7d..5aa9d57b 100644 --- a/include/stdarg.h +++ b/include/stdarg.h @@ -16,15 +16,15 @@ typedef struct { char *reg_save_area; } __va_list_struct; -typedef __va_list_struct va_list; +typedef __va_list_struct va_list[1]; void __va_start(__va_list_struct *ap, void *fp); void *__va_arg(__va_list_struct *ap, int arg_type, int size, int align); -#define va_start(ap, last) __va_start(&ap, __builtin_frame_address(0)) +#define va_start(ap, last) __va_start(ap, __builtin_frame_address(0)) #define va_arg(ap, type) \ - (*(type *)(__va_arg(&ap, __builtin_va_arg_types(type), sizeof(type), __alignof__(type)))) -#define va_copy(dest, src) ((dest) = (src)) + (*(type *)(__va_arg(ap, __builtin_va_arg_types(type), sizeof(type), __alignof__(type)))) +#define va_copy(dest, src) (*(dest) = *(src)) #define va_end(ap) #else /* _WIN64 */