stdarg.h 443 B

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