6502/vbcc/targets/c16x/include/stdarg.h
2022-05-12 21:36:39 +09:30

30 lines
549 B
C

#ifndef __STDARG_H
#define __STDARG_H 1
/*
stdarg for c16x
*/
typedef char *va_list;
va_list __va_start(void);
#define __va_rounded_size(__TYPE) \
(((sizeof (__TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#define va_start(__AP,__LA) (__AP=__va_start())
#define va_arg(__AP, __TYPE) \
(__AP = ((char *) (__AP) + __va_rounded_size (__TYPE)), \
*((__TYPE *)((__AP) - __va_rounded_size (__TYPE))))
#define va_end(__AP) ((__AP) = 0)
#if __STDC_VERSION__ >= 199901L
#define va_copy(new,old) ((new)=(old))
#endif
#endif