home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / BCPPOWL3.ZIP / PATINC.ZIP / VARARGS.H < prev   
Encoding:
C/C++ Source or Header  |  1991-08-28  |  792 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) Borland International 1991
  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 _FAR *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 _FAR *)(((*(char _FAR *_FAR *)&(ap))+=((sizeof(type)+1) & 0xFFFE))-(((sizeof(type)+1) & 0xFFFE))))
  26. #define va_end(ap)   ap = ((void _FAR *)0)
  27.  
  28. #endif    /* __VARARGS_H */
  29.