Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.2 KiB

  1. /***
  2. *stdarg.h - defines ANSI-style macros for variable argument functions
  3. *
  4. * Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file defines ANSI-style macros for accessing arguments
  8. * of functions which take a variable number of arguments.
  9. * [ANSI]
  10. *
  11. ****/
  12. #ifndef _INC_STDARG
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #ifdef _WINDLL
  17. #define _FARARG_ __far
  18. #else
  19. #define _FARARG_
  20. #endif
  21. #if (_MSC_VER <= 600)
  22. #define __far _far
  23. #endif
  24. #ifndef _VA_LIST_DEFINED
  25. typedef char _FARARG_ *va_list;
  26. #define _VA_LIST_DEFINED
  27. #endif
  28. /*
  29. * define a macro to compute the size of a type, variable or expression,
  30. * rounded up to the nearest multiple of sizeof(int). This number is its
  31. * size as function argument (Intel architecture). Note that the macro
  32. * depends on sizeof(int) being a power of 2!
  33. */
  34. #define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
  35. #define va_start(ap,v) ap = (va_list)&v + _INTSIZEOF(v)
  36. #define va_arg(ap,t) ( *(t _FARARG_ *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
  37. #define va_end(ap) ap = (va_list)0
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #define _INC_STDARG
  42. #endif