home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / g__src3 / varargs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-23  |  904 b   |  38 lines

  1. #ifndef __GNUC__
  2. /* Use the system's macros with the system's compiler.  */
  3. #include <varargs.h>
  4. #else
  5. #ifdef __spur__
  6. #include "va-spur.h"
  7. #else
  8. #ifdef __mips__
  9. #include "va-mips.h"
  10. #else
  11.  
  12. /* These macros implement traditional (non-ANSI) varargs
  13.    for GNU C.  */
  14.  
  15. #define va_alist  __builtin_va_alist
  16. #define va_dcl    int __builtin_va_alist;
  17. #define va_list   char *
  18.  
  19. #ifdef __sparc__
  20. #define va_start(AP)                         \
  21.  (__builtin_saveregs (),                    \
  22.   AP = ((void *) &__builtin_va_alist))
  23. #else
  24. #define va_start(AP)  AP=(char *) &__builtin_va_alist
  25. #endif
  26. #define va_end(AP)
  27.  
  28. #define __va_rounded_size(TYPE)  \
  29.   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  30.  
  31. #define va_arg(AP, TYPE)                        \
  32.  (AP += __va_rounded_size (TYPE),                    \
  33.   *((TYPE *) (AP - __va_rounded_size (TYPE))))
  34.  
  35. #endif /* not mips */
  36. #endif /* not spur */
  37. #endif /* __GNUC__ */
  38.