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
1616 char *reg_save_area;
1717 } __va_list_struct;
1818
19−typedef __va_list_struct va_list;
19+typedef __va_list_struct va_list[1];
2020
2121 void __va_start(__va_list_struct *ap, void *fp);
2222 void *__va_arg(__va_list_struct *ap, int arg_type, int size, int align);
2323
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))
2525 #define va_arg(ap, type) \
26− (*(type *)(__va_arg(&ap, __builtin_va_arg_types(type), sizeof(type), __alignof__(type))))
27−#define va_copy(dest, src) ((dest) = (src))
26+ (*(type *)(__va_arg(ap, __builtin_va_arg_types(type), sizeof(type), __alignof__(type))))
27+#define va_copy(dest, src) (*(dest) = *(src))
2828 #define va_end(ap)
2929
3030 #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