History

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.

Daniel Glöckner committed 12 years ago

Commit 3900b231 parent 0ac8aaa1 file · +4 −4Browse files

Unified · Split

include/stdarg.h+4−4
@@ -16,15 +16,15 @@ typedef struct { · 15 unmodified lines
16 char *reg_save_area;16 char *reg_save_area;
17} __va_list_struct;17} __va_list_struct;
18 18
19typedef __va_list_struct va_list;19typedef __va_list_struct va_list[1];
20 20
21void __va_start(__va_list_struct *ap, void *fp);21void __va_start(__va_list_struct *ap, void *fp);
22void *__va_arg(__va_list_struct *ap, int arg_type, int size, int align);22void *__va_arg(__va_list_struct *ap, int arg_type, int size, int align);
23 23
24#define va_start(ap, last) __va_start(&ap, __builtin_frame_address(0))24#define va_start(ap, last) __va_start(ap, __builtin_frame_address(0))
25#define va_arg(ap, type) \25#define va_arg(ap, type) \
26 (*(type *)(__va_arg(&ap, __builtin_va_arg_types(type), sizeof(type), __alignof__(type))))26 (*(type *)(__va_arg(ap, __builtin_va_arg_types(type), sizeof(type), __alignof__(type))))
27#define va_copy(dest, src) ((dest) = (src))27#define va_copy(dest, src) (*(dest) = *(src))
28#define va_end(ap)28#define va_end(ap)
29 29
30#else /* _WIN64 */30#else /* _WIN64 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t