home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / varargs.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  937 b   |  40 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. */
  8.  
  9. /*
  10.  *      C/C++ Run Time Library - Version 10.0
  11.  *
  12.  *      Copyright (c) 1991, 2000 by Inprise Corporation
  13.  *      All Rights Reserved.
  14.  *
  15.  */
  16.  
  17. /* $Revision:   9.1  $ */
  18.  
  19. #ifndef __VARARGS_H
  20. #define __VARARGS_H
  21.  
  22. #ifdef __STDARG_H
  23. #error Can't include both STDARG.H and VARARGS.H
  24. #endif
  25.  
  26. #ifndef ___STDDEF_H
  27. #include <_stddef.h>
  28. #endif
  29.  
  30. typedef void _FAR *va_list;
  31.  
  32. #define __size(x) ((sizeof(x)+sizeof(int)-1) & ~(sizeof(int)-1))
  33.  
  34. #define va_dcl va_list va_alist;
  35. #define va_start(ap) ap = (va_list)&va_alist
  36. #define va_arg(ap, type) (*(type _FAR *)(((*(char _FAR * _FAR *)&(ap))+=__size(type))-(__size(type))))
  37. #define va_end(ap)   ap = ((void _FAR *)0)
  38.  
  39. #endif  /* __VARARGS_H */
  40.