home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gccdist / gcc / include / varargs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-26  |  703 b   |  32 lines

  1. #if !defined(__GNUC__) && !defined(__GNUG__)
  2. /* Use the system's macros with the system's compiler.  */
  3. #include <varargs.h>
  4. #else
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. /* These macros implement traditional (non-ANSI) varargs
  10.    for GNU C.  */
  11.  
  12. #define va_alist  _varargs
  13. #define va_dcl    int _varargs;
  14. #define va_list   char *
  15.  
  16. #define va_count(count)        vaxc$va_count(&count)
  17.  
  18. #define va_start(AP)  AP=(char *) &_varargs
  19. #define va_end(AP)
  20.  
  21. #define _va_rounded_size(TYPE)  \
  22.   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  23.  
  24. #define va_arg(AP, TYPE)                        \
  25.  (AP += _va_rounded_size (TYPE),                    \
  26.   *((TYPE *) (AP - _va_rounded_size (TYPE))))
  27.  
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif
  32.