home *** CD-ROM | disk | FTP | other *** search
/ ANews 3 / AnewsCD3.iso / DP / Programmation / GCC / gcc_include / gvarargs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-16  |  602 b   |  27 lines

  1. /* These macros implement traditional (non-ANSI) varargs for GNU C.  */
  2.  
  3. #ifndef _GVARARGS_H
  4. #define _GVARARGS_H
  5.  
  6. #ifdef _STDARG_H
  7. #undef __va_rounded_size
  8. #undef va_start
  9. #undef va_end
  10. #undef va_arg
  11. #endif
  12.  
  13. #define va_alist    __builtin_va_alist
  14. #define va_dcl        int __builtin_va_alist;
  15. #define va_list        char *
  16.  
  17. #define va_start(AP)    AP=(char *) &__builtin_va_alist
  18. #define va_end(AP)
  19.  
  20. #define __va_rounded_size(TYPE)    \
  21.   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  22.  
  23. #define va_arg(AP, TYPE)        \
  24.  (AP += __va_rounded_size (TYPE),*((TYPE *) (AP - __va_rounded_size (TYPE))))
  25.  
  26. #endif
  27.