home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / va-mips.h < prev    next >
C/C++ Source or Header  |  1991-03-21  |  1KB  |  41 lines

  1. /* ---------------------------------------- */
  2. /*           VARARGS  for MIPS/GNU CC       */
  3. /*                                          */
  4. /*                                          */
  5. /*                                          */
  6. /*                                          */
  7. /* ---------------------------------------- */
  8.  
  9.  
  10. /* These macros implement traditional (non-ANSI) varargs
  11.    for GNU C.  */
  12.  
  13. /* In GCC version 2, we want an ellipsis at the end of the declaration
  14.    of the argument list.  GCC version 1 can't parse it.  */
  15.  
  16. #if __GNUC__ > 1
  17. #define __va_ellipsis ...
  18. #else
  19. #define __va_ellipsis
  20. #endif
  21.  
  22. #define va_alist  __builtin_va_alist
  23. #define va_dcl    int __builtin_va_alist; __va_ellipsis
  24. #ifndef _VA_LIST_
  25. #define _VA_LIST_
  26. #define va_list   char *
  27. #endif
  28.  
  29. #define va_start(AP)  AP = (char *) &__builtin_va_alist
  30. #define va_end(AP)
  31.  
  32. #ifdef lint    /* complains about constant in conditional context */
  33. #define va_arg(list, mode) ((mode *)(list += sizeof(mode)))[-1]
  34.  
  35. #else        /* !lint */
  36. #define va_arg(AP, mode) ((mode *)(AP = \
  37.     (char *) (sizeof(mode) > 4 ? ((int)AP + 2*8 - 1) & -8 \
  38.                    : ((int)AP + 2*4 - 1) & -4)))[-1]
  39. #endif        /* lint */
  40.  
  41.