home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c031 / 4.ddi / INCLUDE / STDDEF.H$ / STDDEF
Encoding:
Text File  |  1991-11-06  |  1.2 KB  |  71 lines

  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.  
  13. #ifndef _INC_STDDEF
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. #if (_MSC_VER <= 600)
  20. #define __cdecl     _cdecl
  21. #define __far       _far
  22. #define __near      _near
  23. #endif
  24.  
  25. /* define the NULL pointer value and the offsetof() macro */
  26.  
  27. #ifndef NULL
  28. #ifdef __cplusplus
  29. #define NULL    0
  30. #else
  31. #define NULL    ((void *)0)
  32. #endif
  33. #endif
  34.  
  35.  
  36. /* offset of field m in a struct s */
  37.  
  38. #define offsetof(s,m)        (size_t)(unsigned long)&(((s *)0)->m)
  39.  
  40.  
  41. /* errno declaration */
  42.  
  43. extern int __near __cdecl volatile errno;
  44.  
  45.  
  46. /* define the implementation dependent size types */
  47.  
  48. #ifndef _PTRDIFF_T_DEFINED
  49. typedef int ptrdiff_t;
  50. #define _PTRDIFF_T_DEFINED
  51. #endif
  52.  
  53. #ifndef _SIZE_T_DEFINED
  54. typedef unsigned int size_t;
  55. #define _SIZE_T_DEFINED
  56. #endif
  57.  
  58. #ifndef _WCHAR_T_DEFINED
  59. typedef    unsigned short wchar_t;
  60. #define _WCHAR_T_DEFINED
  61. #endif
  62.  
  63.  
  64.  
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68.  
  69. #define _INC_STDDEF
  70. #endif    /* _INC_STDDEF */
  71.