home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / va-i860.h < prev    next >
C/C++ Source or Header  |  1991-04-24  |  2KB  |  60 lines

  1. struct __va_struct { int __fixed[12]; int __floating[8]; };
  2.  
  3. typedef struct __va_ctl
  4. {
  5.   struct __va_struct *__regs;
  6.   void *__stack;
  7.   int __nfixed, __nfloating;
  8. } va_list;
  9.  
  10. #define va_alist
  11.  
  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. /* The ... causes current_function_varargs to be set in cc1.  */
  18. #define va_dcl ...
  19. #else
  20. #define va_dcl
  21. #endif
  22.  
  23. #define va_start(pvar) \
  24.  (memcpy (&(pvar), (struct __va_ctl *) __builtin_saveregs (), 80))
  25. #define va_end(pvar)
  26.  
  27. #define va_arg(pvar,type)                    \
  28. ({ type __va_temp;                        \
  29.    *((__builtin_classify_type (__va_temp) < 8            \
  30.       && sizeof __va_temp < 8)                    \
  31.      ? ((pvar).__nfixed < 12                    \
  32.     ? (type *) &(pvar).__regs->__fixed[(pvar).__nfixed++]        \
  33.     : ({                            \
  34.          int temp                        \
  35.            = ((int) ((pvar).__stack + __alignof__ (type) - 1)    \
  36.           & ~(__alignof__ (type) - 1));            \
  37.          (pvar).__stack = (void *) (temp + sizeof (type));    \
  38.          (type *) temp;                     \
  39.        }))                            \
  40.      : __builtin_classify_type (__va_temp) < 9            \
  41.      ? ((pvar).__nfloating < 8                    \
  42.     ? ((pvar).__nfloating                    \
  43.          = (((pvar).__nfloating + 2 * (sizeof __va_temp / 4) - 1) \
  44.         & ~(sizeof __va_temp / 4 - 1)),            \
  45.        (type *) &(pvar).__regs->__floating[(pvar).__nfloating - (sizeof __va_temp / 4)]) \
  46.     : ({                            \
  47.          int temp                        \
  48.            = ((int) ((pvar).__stack + __alignof__ (type) - 1)    \
  49.           & ~(__alignof__ (type) - 1));            \
  50.          (pvar).__stack = (void *) (temp + sizeof (type));    \
  51.          (type *) temp;                     \
  52.        }))                            \
  53.      : ({                            \
  54.       int temp                        \
  55.         = ((int) ((pvar).__stack + __alignof__ (type) - 1)    \
  56.            & ~(__alignof__ (type) - 1));            \
  57.       (pvar).__stack = (void *) (temp + sizeof (type));    \
  58.       (type *) temp;                     \
  59.     })); })
  60.