home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / linux / atari / source / source.lzh / atari-linux-0.01pl3 / include / stdarg.h < prev   
Encoding:
C/C++ Source or Header  |  1994-06-05  |  1.1 KB  |  44 lines

  1. /*
  2.  * STDARG.H
  3.  */
  4.  
  5. #ifndef _STDARG_H
  6. #ifndef va_start    /* in case of varargs being included */
  7. #define    _STDARG_H
  8.  
  9.  
  10. /* Define __gnuc_va_list.  */
  11.  
  12. #ifndef __GNUC_VA_LIST
  13. #define __GNUC_VA_LIST
  14. typedef void *__gnuc_va_list;
  15. #endif
  16.  
  17. /* Amount of space required in an argument list for an arg of type TYPE.
  18.    TYPE may alternatively be an expression whose type is used.  */
  19.  
  20. #define __va_rounded_size(TYPE)  \
  21.   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  22.  
  23. #define va_start(AP, LASTARG)                         \
  24.  (AP = ((__gnuc_va_list) __builtin_next_arg ()))
  25.  
  26. #define va_end(AP)
  27.  
  28. /* We cast to void * and then to TYPE * because this avoids
  29.    a warning about increasing the alignment requirement.  */
  30. #define va_arg(AP, TYPE)                                                \
  31.  (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)),    \
  32.   *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < sizeof (int)    \
  33.                      ? sizeof (TYPE)        \
  34.                      : __va_rounded_size (TYPE))))))
  35.  
  36. #ifndef _VA_LIST_
  37. #define _VA_LIST_
  38. typedef __gnuc_va_list va_list;
  39. #endif /* _VA_LIST_ */
  40.  
  41. #endif /* va_start */
  42.  
  43. #endif /* _STDARG_H */
  44.