home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / ansi / m68k / stdarg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-01  |  785 b   |  31 lines

  1. #ifndef _ANSI_M68K_STDARG_H_
  2. #define _ANSI_M68K_STDARG_H_
  3.  
  4. // BSD compatibility: if #include <varargs.h> seen, don't redefine per ANSI
  5. #ifndef __VARARGS__
  6.  
  7. // Indicate that this program uses <stdarg.h>
  8. #define    __STDARG__
  9.  
  10. typedef char *va_list;
  11.  
  12. /* Amount of space required in an argument list for an arg of type TYPE.
  13.    TYPE may alternatively be an expression whose type is used.  */
  14.  
  15. #define __va_rounded_size(TYPE)  \
  16.   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  17.  
  18. #define va_start(AP, LASTARG)                         \
  19.  (AP = ((char *) __builtin_next_arg ()))
  20.  
  21. void va_end (va_list);
  22. #define va_end(AP)
  23.  
  24. #define va_arg(AP, TYPE)                        \
  25.  (AP += __va_rounded_size (TYPE),                    \
  26.   *((TYPE *) (AP - __va_rounded_size (TYPE))))
  27.  
  28. #endif    __VARARGS__
  29.  
  30. #endif    _ANSI_M68K_STDARG_H_
  31.