home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / DMAKE37S.ZIP / DMAKE / UNIX / SYSVR4 / STDARG.H < prev   
Encoding:
C/C++ Source or Header  |  1991-05-06  |  819 b   |  32 lines

  1. /* Some V.4 systems aren't ansi, just to make matters ugly.
  2.    If the dmake sources used another name for this include file,
  3.    then this wouldn't be quite so awful. */
  4. #ifdef __STDC__
  5. #include "/usr/include/stdarg.h"
  6. #else
  7. /*
  8.  * stdarg.h
  9.  *
  10.  * defines ANSI style macros for accessing arguments of a function which takes
  11.  * a variable number of arguments
  12.  *
  13.  */
  14.  
  15. typedef char *va_list;
  16.  
  17. #if defined(sparc)
  18. # define va_alist __builtin_va_alist
  19. #endif
  20. # define va_dcl int va_alist
  21. # define va_start(list,v) list = (char *)&va_alist
  22. # define va_end(list)     list = NULL
  23. #if defined(mips)
  24. #define va_arg(list, mode) ((mode *)(list = \
  25.     (char *) (sizeof(mode) > 4 ? ((int)list + 2*8 - 1) & -8 \
  26.                    : ((int)list + 2*4 - 1) & -4)))[-1]
  27. #else
  28. # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1]
  29. #endif
  30. #endif
  31.  
  32.