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#include <va_list.h>
35
36
37#ifdef __cplusplus
38extern "C"
39{
40#endif
41
42 /* width of stack == width of int */
43#define STACKITEM int64_t
44
45 /* round up width of objects pushed on stack. The expression before the
46 & ensures that we get 0 for objects of size 0. */
47#define VA_SIZE(TYPE) \
48 ((sizeof(TYPE)+sizeof(STACKITEM)-1) \
49 & ~(sizeof(STACKITEM)-1))
50
51 /* &(LASTARG) points to the LEFTMOST argument of the function call
52 (before the ...) */
53#define va_start(AP, LASTARG) \
54 (AP = ((va_list)&(LASTARG)+VA_SIZE(LASTARG)))
55
56 /* nothing for va_end */
57#define va_end(AP)
58
59#define va_arg(AP, TYPE) \
60 (AP += VA_SIZE(TYPE), *((TYPE *)(AP - VA_SIZE(TYPE))))
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif