home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 5.ddi / MWHC.005 / O1 < prev    next >
Encoding:
Text File  |  1992-01-07  |  808 b   |  33 lines

  1. /*
  2.  *   stdarg.h -- ANSI 
  3.  *
  4.  *   Macros and type for functions the require variable
  5.  *   numbers of arguments.
  6.  *
  7.  *           Copyright (c) 1990, MetaWare Incorporated
  8.  */
  9.  
  10. #ifndef _STDARG_H
  11. #define _STDARG_H
  12.  
  13. #if !__HIGHC__
  14. #define _max(a,b) ((a)>(b)?(a):(b))
  15. #endif
  16.  
  17. #ifndef _VA_LIST_DEFINED
  18. #    define _VA_LIST_DEFINED
  19.      typedef char *va_list;
  20. #endif
  21.  
  22. /* Minimum size of a parameter:  round to the number of ints; must be at least one int. */
  23. #define __psize(parmsize) _max(sizeof(int), ((parmsize)+sizeof(int)-1)/sizeof(int)*sizeof(int) )
  24.  
  25. #define va_start(ap, parmN) ( ap = (char *) &parmN + __psize(sizeof(parmN)) )
  26.  
  27. #define va_arg(ap, type) ( \
  28.        *(type *) ((ap += __psize(sizeof(type)) ) - __psize(sizeof(type)))  )
  29.  
  30. #define va_end(ap)
  31.  
  32. #endif /* _STDARG_H */
  33.