home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c063 / 1.ddi / INCLUDE.ZIP / STDARG.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-18  |  844 b   |  39 lines

  1. /*  stdarg.h
  2.  
  3.     Definitions for accessing parameters in functions that accept
  4.     a variable number of arguments.
  5.  
  6.     Copyright (c) 1987, 1991 by Borland International
  7.     All Rights Reserved.
  8. */
  9.  
  10. #ifndef __STDARG_H
  11. #define __STDARG_H
  12.  
  13. #ifdef __VARARGS_H
  14. #error Can't include both STDARG.H and VARARGS.H
  15. #endif
  16.  
  17. #if !defined( __DEFS_H )
  18. #include <_defs.h>
  19. #endif
  20.  
  21. typedef void *va_list;
  22.  
  23. #define __size(x) ((sizeof(x)+sizeof(int)-1) & ~(sizeof(int)-1))
  24.  
  25. #ifdef  __cplusplus
  26. #define va_start(ap, parmN) (ap = ...)
  27. #else
  28. #define va_start(ap, parmN) ((void)((ap) = (va_list)((char *)(&parmN)+__size(parmN))))
  29. #endif
  30.  
  31. #define va_arg(ap, type) (*(type *)(((*(char **)&(ap))+=__size(type))-(__size(type))))
  32. #define va_end(ap)          ((void)0)
  33.  
  34. #if !__STDC__
  35. #define _va_ptr             (...)
  36. #endif
  37.  
  38. #endif
  39.