home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / borhead.zip / STDARG.H < prev    next >
C/C++ Source or Header  |  1994-11-09  |  881b  |  40 lines

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