home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 2.ddi / INCLUDE.ZIP / VARARGS.H < prev   
Encoding:
C/C++ Source or Header  |  1991-02-13  |  951 b   |  43 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. #ifdef __DLL__
  19. #define _FAR far
  20. #else
  21. #define _FAR
  22. #endif
  23.  
  24. #if __STDC__
  25. #define _Cdecl
  26. #else
  27. #define _Cdecl  cdecl
  28. #endif
  29.  
  30. #ifndef __PAS__
  31. #define _CType _Cdecl
  32. #else
  33. #define _CType pascal
  34. #endif
  35.  
  36. typedef void _FAR *va_list;
  37. #define va_dcl va_list va_alist;
  38. #define va_start(ap) ap = (va_list)&va_alist
  39. #define va_arg(ap, type) (*(type _FAR *)(((*(char _FAR *_FAR *)&(ap))+=((sizeof(type)+1) & 0xFFFE))-(((sizeof(type)+1) & 0xFFFE))))
  40. #define va_end(ap)   ap = ((void _FAR *)0)
  41.  
  42. #endif    /* __VARARGS_H */
  43.