stdarg.h 619 B

1234567891011121314151617181920212223
  1. #ifndef _STDARG_H
  2. #define _STDARG_H
  3. typedef char *va_list;
  4. /* Amount of space required in an argument list for an arg of type TYPE.
  5. TYPE may alternatively be an expression whose type is used. */
  6. #define __va_rounded_size(TYPE) \
  7. (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  8. #define va_start(AP, LASTARG) \
  9. (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
  10. void va_end (va_list); /* Defined in gnulib */
  11. #define va_end(AP)
  12. #define va_arg(AP, TYPE) \
  13. (AP += __va_rounded_size (TYPE), \
  14. *((TYPE *) (AP - __va_rounded_size (TYPE))))
  15. #endif /* _STDARG_H */