stdarg.h 494 B

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