home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Headers / bsd / hppa / varargs.h < prev    next >
C/C++ Source or Header  |  1995-01-23  |  858b  |  33 lines

  1. #ifndef _BSD_HPPA_VARARGS_H_
  2. #define _BSD_HPPA_VARARGS_H_
  3.  
  4. /* Indicate that this program uses <varargs.h>. */
  5. #define    __VARARGS__
  6.  
  7. #ifdef __STRICT_ANSI__
  8. #error <varargs.h> should not be included in an ANSI C program.
  9. #endif /* __STRICT_ANSI__ */
  10.  
  11. /* If ansi/stdarg.h was included, this overrides */
  12. #undef va_start
  13. #undef va_end
  14. #undef va_arg
  15.  
  16. /* Get the definition of `va_list'. */
  17. #define _DEFINE_VA_LIST
  18. #include <ansi/hppa/stdtypes.h>
  19.  
  20. #define va_dcl int va_alist;
  21.  
  22. #define __va_rounded_size(TYPE)  \
  23.   ((sizeof (TYPE) + sizeof (int) - 1) & ~(sizeof(int)-1))
  24.  
  25. #define va_start(AP) \
  26.     (void)((AP) = ((char *)__builtin_saveregs()))
  27. #define va_end(AP) \
  28.     (void)((AP) = (char *)0)
  29. #define va_arg(AP, type) \
  30.     (*(type *)((AP) = (va_list)((unsigned)((AP) -__va_rounded_size(type)) & ~(__va_rounded_size(type)-1))))
  31.  
  32. #endif    /* _BSD_HPPA_VARARGS_H_ */
  33.