XenevaOS
Loading...
Searching...
No Matches
stdarg.h
Go to the documentation of this file.
1
30#ifndef __STDARG_H__
31#define __STDARG_H__
32
33
34#ifdef __cplusplus
35extern "C"
36{
37#endif
38
39
40 /* va list parameter list */
41 typedef unsigned char *va_list;
42
43
44 /* width of stack == width of int */
45#define STACKITEM int64_t
46
47 /* round up width of objects pushed on stack. The expression before the
48 & ensures that we get 0 for objects of size 0. */
49#define VA_SIZE(TYPE) \
50 ((sizeof(TYPE)+sizeof(STACKITEM)-1) \
51 & ~(sizeof(STACKITEM)-1))
52
53 /* &(LASTARG) points to the LEFTMOST argument of the function call
54 (before the ...) */
55#define va_start(AP, LASTARG) \
56 (AP = ((va_list)&(LASTARG)+VA_SIZE(LASTARG)))
57
58 /* nothing for va_end */
59#define va_end(AP)
60
61#define va_arg(AP, TYPE) \
62 (AP += VA_SIZE(TYPE), *((TYPE *)(AP - VA_SIZE(TYPE))))
63
64#ifdef __cplusplus
65}
66#endif
67
68
69#endif
unsigned char * va_list
Definition stdarg.h:41