home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / unix / unixlib_1 / !UnixLib37_src_clib_h_varargs < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-09  |  946 b   |  39 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/clib/h/RCS/varargs,v $
  4.  * $Date: 1996/04/19 21:02:57 $
  5.  * $Revision: 1.1 $
  6.  * $State: Rel $
  7.  * $Author: simon $
  8.  *
  9.  * $Log: varargs,v $
  10.  * Revision 1.1  1996/04/19 21:02:57  simon
  11.  * Initial revision
  12.  *
  13.  ***************************************************************************/
  14.  
  15. #ifndef __VARARGS_H
  16. #define __VARARGS_H
  17. #define __STDARG_H
  18.  
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. typedef char *va_list;
  24.  
  25. #define va_align(x)    (((x) + (sizeof(int) - 1)) & (~(sizeof(int) - 1)))
  26.  
  27. #define va_dcl        int va_alist;
  28. #define va_start(a)    ((void)(a = (char *)(&va_alist)))
  29. #define va_arg(a,t)    ((sizeof(t) > sizeof(int)) ? \
  30.     *(t *)(((a) += va_align(sizeof(t))) - va_align(sizeof(t))) : \
  31.     (t)(*(int *)(((a) += sizeof(int)) - sizeof(int))))
  32. #define va_end(a)    ((void)((a) = (char *)-1))
  33.  
  34. #ifdef __cplusplus
  35.     }
  36. #endif
  37.  
  38. #endif
  39.