diff options
Diffstat (limited to 'include/stdarg.h')
| -rw-r--r-- | include/stdarg.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/stdarg.h b/include/stdarg.h new file mode 100644 index 0000000..8eb1341 --- /dev/null +++ b/include/stdarg.h @@ -0,0 +1,27 @@ +/* + * stdarg.h + * + * Provides va_list and associated functions + */ + +#ifndef _STDARG_H +#define _STDARG_H + +typedef char* va_list; + +#define __va_rounded_size(TYPE) \ + (((sizeof(TYPE) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) + +#define va_start(AP, LAST) \ + (AP = ((char*) &LAST + __va_rounded_size(LAST))) + +#define va_arg(AP, TYPE) \ + (AP += __va_rounded_size(TYPE), \ + *((TYPE*) (AP - __va_rounded_size(TYPE)))) + +#define va_end(AP) + +#define va_copy(DEST, SRC) \ + (DEST = SRC) + +#endif |
