home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / stdarg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  1.2 KB  |  56 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 10.0
  10.  *
  11.  *      Copyright (c) 1987, 2000 by Inprise Corporation
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16. /* $Revision:   9.2  $ */
  17.  
  18. #ifndef __STDARG_H
  19. #define __STDARG_H
  20. #define _INC_STDARG  /* MSC Guard name */
  21.  
  22. #ifdef __VARARGS_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. #ifdef __cplusplus
  31. namespace std {
  32. #endif /* __cplusplus */
  33.  
  34. typedef void _FAR *va_list;
  35.  
  36. #define __size(x) ((sizeof(x)+sizeof(int)-1) & ~(sizeof(int)-1))
  37.  
  38. #define va_start(ap, parmN) ((void)((ap) = (va_list)((char _FAR *)(&parmN)+__size(parmN))))
  39. #define va_arg(ap, type) (*(type _FAR *)(((*(char _FAR *_FAR *)&(ap))+=__size(type))-(__size(type))))
  40. #define va_end(ap)          ((void)0)
  41.  
  42. #if !defined(__STDC__)
  43. #define _va_ptr             (...)
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. } // std
  48. #endif /* __cplusplus */
  49.  
  50. #endif  /* __STDARG_H */
  51.  
  52. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__STDARG_H_USING_LIST)
  53. #define __STDARG_H_USING_LIST
  54.      using std::va_list;
  55. #endif /* __USING_CNAME__ */
  56.