stdarg.h 569 B

12345678910111213141516171819202122
  1. #ifndef __STDARG
  2. #define __STDARG
  3. typedef unsigned long long va_list;
  4. /* stdarg - little-endian 64-bit */
  5. #define va_start(list, start) list =\
  6. (sizeof(start) < 4?\
  7. (unsigned long long)((long*)&(start)+1):\
  8. (unsigned long long)(&(start)+1))
  9. #define va_end(list)\
  10. USED(list)
  11. #define va_arg(list, mode)\
  12. ((sizeof(mode) == 1)?\
  13. ((list += 4), (mode*)list)[-4]:\
  14. (sizeof(mode) == 2)?\
  15. ((list += 4), (mode*)list)[-2]:\
  16. (sizeof(mode) == 4)?\
  17. ((list += 4), (mode*)list)[-1]:\
  18. ((list += sizeof(mode)+7), (list &= ~7), (mode*)list)[-1])
  19. #endif /* __STDARG */