Added stdarg.h

This commit is contained in:
Max Wash
2021-03-04 16:52:31 +00:00
parent 2c197ead3e
commit ad355938a5

View File

@@ -0,0 +1,20 @@
#ifndef STDARG_H
#define STDARG_H
//typedef struct __va_list_tag *va_list;
typedef __builtin_va_list va_list;
# if defined(__GNUC__) && __GNUC__ >= 3
#define va_start(ap, arg) __builtin_va_start((ap), (arg))
#define va_arg __builtin_va_arg
#define va_copy __builtin_va_copy
#define va_end(ap) __builtin_va_end((ap))
#else
#error Unsupported compiler
#define va_start(ap, arg) ((ap) = ((va_list)&(arg)) + ((sizeof(long) > sizeof(arg)) ? sizeof(long) : sizeof(arg)))
#define va_arg(ap, type) *(type *)(ap), ((ap) += ((sizeof(long) > sizeof(type)) ? sizeof(long) : sizeof(type)))
#define va_copy(copy, arg) ((copy) = (arg))
#define va_end(ap)
#endif
#endif