home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dmake40.zip / unix / sysvr4 / stdarg.h < prev   
C/C++ Source or Header  |  1994-10-23  |  970b  |  39 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. #if defined(__STDC__) || defined(_VA_LIST)
  5. #include </usr/include/stdarg.h>
  6. #ifdef va_dcl
  7. #undef va_dcl
  8. #endif
  9. #define va_dcl int va_alist
  10. #else
  11. /*
  12.  * stdarg.h
  13.  *
  14.  * defines ANSI style macros for accessing arguments of a function which takes
  15.  * a variable number of arguments
  16.  *
  17.  */
  18.  
  19. typedef char *va_list;
  20.  
  21. #if defined(sparc)
  22. # define va_alist __builtin_va_alist
  23. #endif
  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.  
  34. #ifndef va_dcl
  35. # define va_dcl int va_alist
  36. #endif
  37. #endif
  38.  
  39.