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

  1. /*  varargs.h
  2.  
  3.     Definitions for accessing parameters in functions that accept
  4.     a variable number of arguments.  These macros are compatible
  5.     with UNIX System V.  Use stdarg.h for ANSI C compatibility.
  6.  
  7.     Copyright (c) 1991 by Borland International
  8.     All Rights Reserved.
  9. */
  10.  
  11. #ifndef __VARARGS_H
  12. #define __VARARGS_H
  13.  
  14. #ifdef __STDARG_H
  15. #error Can't include both STDARG.H and VARARGS.H
  16. #endif
  17.  
  18. #if !defined( __DEFS_H )
  19. #include <_defs.h>
  20. #endif
  21.  
  22. typedef void *va_list;
  23. #define va_dcl va_list va_alist;
  24. #define va_start(ap) ap = (va_list)&va_alist
  25. #define va_arg(ap, type) (*(type *)(((*(char **)&(ap))+=((sizeof(type)+1) & 0xFFFE))-(((sizeof(type)+1) & 0xFFFE))))
  26. #define va_end(ap)   ap = ((void *)0)
  27.  
  28. #endif  /* __VARARGS_H */
  29.