diff options
| author | Daniel Glöckner <daniel-gl@gmx.net> | 2014-03-30 00:08:05 +0100 |
|---|---|---|
| committer | Daniel Glöckner <daniel-gl@gmx.net> | 2014-03-30 00:13:58 +0100 |
| commit | 3900b235e06af99f46714eb7950cd3fcc3b11c61 (patch) | |
| tree | 4c5a45bb542fbefbca9afd28a65ffddb112b99ed /include/stdarg.h | |
| parent | 0ac8aaab1bef770929e5592d02bc06d3a529952e (diff) | |
| download | tinycc-3900b235e06af99f46714eb7950cd3fcc3b11c61.tar.gz tinycc-3900b235e06af99f46714eb7950cd3fcc3b11c61.tar.bz2 | |
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.
Diffstat (limited to 'include/stdarg.h')
| -rw-r--r-- | include/stdarg.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/stdarg.h b/include/stdarg.h index b6a30f7..5aa9d57 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 */ |
