home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / gccsrc2 / va_i860.h < prev    next >
C/C++ Source or Header  |  1993-07-23  |  2KB  |  51 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. #define va_dcl
  13.  
  14. #define va_start(pvar) \
  15.  (memcpy (&(pvar), (struct __va_ctl *) __builtin_saveregs (), 80))
  16. #define va_end(pvar)
  17.  
  18. #define va_arg(pvar,type)                    \
  19. ({ type __va_temp;                        \
  20.    *((__builtin_classify_type (__va_temp) < 8            \
  21.       && sizeof __va_temp < 8)                    \
  22.      ? ((pvar).nfixed < 12                    \
  23.     ? (type *) &(pvar).regs->fixed[(pvar).nfixed++]        \
  24.     : ({                            \
  25.          int temp                        \
  26.            = ((int) ((pvar).stack + __alignof__ (type) - 1)    \
  27.           & ~(__alignof__ (type) - 1));            \
  28.          (pvar).stack = (void *) (temp + sizeof (type));    \
  29.          (type *) temp;                     \
  30.        }))                            \
  31.      : __builtin_classify_type (__va_temp) < 9            \
  32.      ? ((pvar).nfloating < 8                    \
  33.     ? ((pvar).nfloating                    \
  34.          = (((pvar).nfloating + 2 * (sizeof __va_temp / 4) - 1) \
  35.         & ~(sizeof __va_temp / 4 - 1)),            \
  36.        (type *) &(pvar).regs->floating[(pvar).nfloating - (sizeof __va_temp / 4)]) \
  37.     : ({                            \
  38.          int temp                        \
  39.            = ((int) ((pvar).stack + __alignof__ (type) - 1)    \
  40.           & ~(__alignof__ (type) - 1));            \
  41.          (pvar).stack = (void *) (temp + sizeof (type));    \
  42.          (type *) temp;                     \
  43.        }))                            \
  44.      : ({                            \
  45.       int temp                        \
  46.         = ((int) ((pvar).stack + __alignof__ (type) - 1)    \
  47.            & ~(__alignof__ (type) - 1));            \
  48.       (pvar).stack = (void *) (temp + sizeof (type));    \
  49.       (type *) temp;                     \
  50.     })); })
  51.