home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume26 / cook-1.4 / part01 / h / stdarg.h-min < prev    next >
Encoding:
Text File  |  1993-05-03  |  578 b   |  22 lines

  1. /*
  2.  * This stadrg.h works for simple machines, such as 68K or 386.
  3.  * It assumes the stack grows downwards, and that no arguments are
  4.  * stored in registers.
  5.  *
  6.  * This stdarg.h does not work for Sun sparc or MIPS,
  7.  * and probably not any other RISC machine, either.
  8.  *
  9.  * MANIFEST: minimal stdarg.h replacement
  10.  */
  11.  
  12. #ifndef _STDARG_H
  13. #define _STDARG_H
  14.  
  15. typedef char *va_list;
  16. #define va_start(ap,parmn) (void)((ap) = (char*)(&(parmn) + 1))
  17. #define va_end(ap) (void)((ap) = 0)
  18. #define va_arg(ap, type) \
  19.     (((type*)((ap) = ((ap) + sizeof(type))))[-1])
  20.  
  21. #endif /* _STDARG_H */
  22.