home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / DMAKE38C.ZIP / UNIX / SYSVR4 / STDARG.H < prev   
C/C++ Source or Header  |  1992-01-23  |  869b  |  35 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. #ifndef va_dcl
  7. #define va_dcl int va_alist
  8. #endif
  9. #else
  10. /*
  11.  * stdarg.h
  12.  *
  13.  * defines ANSI style macros for accessing arguments of a function which takes
  14.  * a variable number of arguments
  15.  *
  16.  */
  17.  
  18. typedef char *va_list;
  19.  
  20. #if defined(sparc)
  21. # define va_alist __builtin_va_alist
  22. #endif
  23. # define va_dcl int va_alist
  24. # define va_start(list,v) list = (char *)&va_alist
  25. # define va_end(list)     list = NULL
  26. #if defined(mips)
  27. #define va_arg(list, mode) ((mode *)(list = \
  28.     (char *) (sizeof(mode) > 4 ? ((int)list + 2*8 - 1) & -8 \
  29.                    : ((int)list + 2*4 - 1) & -4)))[-1]
  30. #else
  31. # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1]
  32. #endif
  33. #endif
  34.  
  35.