stdarg.h 529 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. /* little-endian 32-bit */
  10. #define va_arg(list, mode)\
  11. ((sizeof(mode) == 1)?\
  12. ((list += 4), (mode*)list)[-4]:\
  13. (sizeof(mode) == 2)?\
  14. ((list += 4), (mode*)list)[-2]:\
  15. (sizeof(mode) == 4)?\
  16. ((list += 4), (mode*)list)[-1]:\
  17. ((list = (char*)((unsigned long)(list+7) & ~7) + sizeof(mode)), (mode*)list)[-1])
  18. #endif /* __STDARG */