00001
00024 #ifndef _ANEXT_STDARG_H
00025 #define _ANEXT_STDARG_H
00026
00027 #include <nlibc.h>
00028
00029
00030
00035 #ifndef _VA_LIST_T
00036 #define _VA_LIST_T
00037 typedef nodeprivate vector int va_list;
00038 #endif
00039
00040 #define argwidth(n) ((sizeof(n)+sizeof(int)-1) & ~(sizeof(int)-1))
00041 #define va_rounded_size(type) (((sizeof(type)+sizeof(int)-1)/sizeof(int))*sizeof(int))
00042
00078 #define va_start(list, start) \
00079 do { \
00080 asm("\t!! begin va_start()"); \
00081 (list).lo = (int)(__builtin_argoffset(start)+1); \
00082 (list).hi = (int)(__builtin_argcount(start)); \
00083 asm("\t!! end va_start()"); \
00084 } while(0)
00085
00086
00109 #define va_end(list) asm("\t!! va_end()")
00110
00160 #define va_arg(ap, type) (ap.lo++, ap.hi--, *(type *)((ap).lo++))
00161
00162
00168 #define _va_info(ap) (*(vector int *)((ap).lo++))
00169
00170
00175 #define _va_arg(ap, type) (*(type *)((ap).lo++))
00176
00177
00182 #define _va_ptr(ap) ((void *)((ap).lo))
00183
00184
00188 #define _va_args(ap) ((ap).hi)
00189
00190
00196 #define _va_skip(ap, size) do { (ap).lo += size; } while(0)
00197
00198
00218 #define va_copy(dest,src) ((dest) = (src))
00219
00220 #endif
00221
00222