home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c034 / 4.ddi / INCLUDE / VARARGS.H$ / VARARGS.bin
Encoding:
Text File  |  1990-01-08  |  922 b   |  44 lines

  1. /***
  2. *varargs.h - XENIX style macros for variable argument functions
  3. *
  4. *    Copyright (c) 1985-1990, Microsoft Corporation.  All rights reserved.
  5. *
  6. *Purpose:
  7. *    This file defines XENIX style macros for accessing arguments of a
  8. *    function which takes a variable number of arguments.
  9. *    [System V]
  10. *
  11. ****/
  12.  
  13. #if defined(_DLL) && !defined(_MT)
  14. #error Cannot define _DLL without _MT
  15. #endif
  16.  
  17. #ifdef _MT
  18. #define _FAR_ _far
  19. #else
  20. #define _FAR_
  21. #endif
  22.  
  23. /* define NULL pointer value */
  24.  
  25. #ifndef NULL
  26. #if (_MSC_VER >= 600)
  27. #define NULL    ((void *)0)
  28. #elif (defined(M_I86SM) || defined(M_I86MM))
  29. #define NULL    0
  30. #else
  31. #define NULL    0L
  32. #endif
  33. #endif
  34.  
  35. #ifndef _VA_LIST_DEFINED
  36. typedef char _FAR_ *va_list;
  37. #define _VA_LIST_DEFINED
  38. #endif
  39.  
  40. #define va_dcl va_list va_alist;
  41. #define va_start(ap) ap = (va_list)&va_alist
  42. #define va_arg(ap,t) ((t _FAR_ *)(ap += sizeof(t)))[-1]
  43. #define va_end(ap) ap = NULL
  44.