7 //This should be in sync with the declaration on our lib/libtcc1.c
8 /* GCC compatible definition of va_list. */
10 unsigned int gp_offset
;
11 unsigned int fp_offset
;
13 unsigned int overflow_offset
;
14 char *overflow_arg_area
;
19 typedef __va_list_struct
va_list[1];
21 void __va_start(__va_list_struct
*ap
, void *fp
);
22 void *__va_arg(__va_list_struct
*ap
, int arg_type
, int size
, int align
);
24 #define va_start(ap, last) __va_start(ap, __builtin_frame_address(0))
25 #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))
30 /* avoid conflicting definition for va_list on Macs. */
34 typedef char *va_list;
35 #define va_start(ap,last) __builtin_va_start(ap,last)
36 #define va_arg(ap, t) ((sizeof(t) > 8 || (sizeof(t) & (sizeof(t) - 1))) \
37 ? **(t **)((ap += 8) - 8) : *(t *)((ap += 8) - 8))
38 #define va_copy(dest, src) ((dest) = (src))
43 typedef char *va_list;
44 #define _tcc_alignof(type) ((int)&((struct {char c;type x;} *)0)->x)
45 #define _tcc_align(addr,type) (((unsigned)addr + _tcc_alignof(type) - 1) \
46 & ~(_tcc_alignof(type) - 1))
47 #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
48 #define va_arg(ap,type) (ap = (void *) ((_tcc_align(ap,type)+sizeof(type)+3) \
49 &~3), *(type *)(ap - ((sizeof(type)+3)&~3)))
50 #define va_copy(dest, src) (dest) = (src)
53 #elif defined(__aarch64__)
61 #define va_start(ap, last) __va_start(ap, last)
62 #define va_arg(ap, type) __va_arg(ap, type)
64 #define va_copy(dest, src) ((dest) = (src))
67 typedef char *va_list;
68 /* only correct for i386 */
69 #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
70 #define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))
71 #define va_copy(dest, src) (dest) = (src)
75 /* fix a buggy dependency on GCC in libio.h */
76 typedef va_list __gnuc_va_list
;
77 #define _VA_LIST_DEFINED
79 #endif /* _STDARG_H */