stdarg.h 413 B

1234567891011121314151617
  1. #ifndef __STDARG
  2. #define __STDARG
  3. typedef char *va_list;
  4. #define va_start(list, start) list = (char *)(&(start)+1)
  5. #define va_end(list)
  6. #define va_arg(list, mode)\
  7. (sizeof(mode)==1?\
  8. ((mode*)(list += 4))[-1]:\
  9. sizeof(mode)==2?\
  10. ((mode*)(list += 4))[-1]:\
  11. sizeof(mode)>4?\
  12. ((mode*)(list = (char*)((long)(list+7) & ~7) + sizeof(mode)))[-1]:\
  13. ((mode*)(list += sizeof(mode)))[-1])
  14. #endif /* __STDARG */