source: EcnlProtoTool/trunk/tcc-0.9.26/include/stdarg.h@ 279

Last change on this file since 279 was 279, checked in by coas-nagasima, 7 years ago

ファイルを追加、更新。

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 1.2 KB
Line 
1#ifndef _STDARG_H
2#define _STDARG_H
3
4#ifdef __x86_64__
5#ifndef _WIN64
6
7typedef void *va_list;
8
9va_list __va_start(void *fp);
10void *__va_arg(va_list ap, int arg_type, int size);
11va_list __va_copy(va_list src);
12void __va_end(va_list ap);
13
14#define va_start(ap, last) ((ap) = __va_start(__builtin_frame_address(0)))
15#define va_arg(ap, type) \
16 (*(type *)(__va_arg(ap, __builtin_va_arg_types(type), sizeof(type))))
17#define va_copy(dest, src) ((dest) = __va_copy(src))
18#define va_end(ap) __va_end(ap)
19
20#else /* _WIN64 */
21typedef char *va_list;
22#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+7)&~7)
23#define va_arg(ap,type) (ap += (sizeof(type)+7)&~7, *(type *)(ap - ((sizeof(type)+7)&~7)))
24#define va_copy(dest, src) (dest) = (src)
25#define va_end(ap)
26#endif
27
28#else /* __i386__ */
29typedef char *va_list;
30/* only correct for i386 */
31#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
32#define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))
33#define va_copy(dest, src) (dest) = (src)
34#define va_end(ap)
35#endif
36
37/* fix a buggy dependency on GCC in libio.h */
38typedef va_list __gnuc_va_list;
39#define _VA_LIST_DEFINED
40
41#endif /* _STDARG_H */
Note: See TracBrowser for help on using the repository browser.