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.

80 lines
1.4 KiB

  1. /***
  2. *stddef.h - definitions/declarations for common constants, types, variables
  3. *
  4. * Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file contains definitions and declarations for some commonly
  8. * used constants, types, and variables.
  9. * [ANSI]
  10. *
  11. ****/
  12. #ifndef _INC_STDDEF
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #if (_MSC_VER <= 600)
  17. #define __cdecl _cdecl
  18. #define __far _far
  19. #define __near _near
  20. #endif
  21. /* define the NULL pointer value and the offsetof() macro */
  22. #ifndef NULL
  23. #ifdef __cplusplus
  24. #define NULL 0
  25. #else
  26. #define NULL ((void *)0)
  27. #endif
  28. #endif
  29. /* offset of field m in a struct s */
  30. #define offsetof(s,m) (size_t)( (char *)&(((s *)0)->m) - (char *)0 )
  31. /* errno declaration */
  32. #ifdef _MT
  33. extern int __far * __cdecl __far volatile _errno(void);
  34. #define errno (*_errno())
  35. #else
  36. extern int __near __cdecl volatile errno;
  37. #endif
  38. /* define the implementation dependent size types */
  39. #ifndef _PTRDIFF_T_DEFINED
  40. typedef int ptrdiff_t;
  41. #define _PTRDIFF_T_DEFINED
  42. #endif
  43. #ifndef _SIZE_T_DEFINED
  44. typedef unsigned int size_t;
  45. #define _SIZE_T_DEFINED
  46. #endif
  47. #ifndef _WCHAR_T_DEFINED
  48. typedef unsigned short wchar_t;
  49. #define _WCHAR_T_DEFINED
  50. #endif
  51. #ifdef _MT
  52. /* define pointer to thread id value */
  53. extern int __far *_threadid;
  54. #endif
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #define _INC_STDDEF
  59. #endif