home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 20.ddi / INCLUDE / STDDEF.H_ / STDDEF.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  1.4 KB  |  81 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)( (char *)&(((s *)0)->m) - (char *)0 )
  39.  
  40.  
  41. /* errno declaration */
  42.  
  43. #ifdef _MT
  44. extern int __far * __cdecl __far volatile _errno(void);
  45. #define errno   (*_errno())
  46. #else 
  47. extern int __near __cdecl volatile errno;
  48. #endif 
  49.  
  50.  
  51. /* define the implementation dependent size types */
  52.  
  53. #ifndef _PTRDIFF_T_DEFINED
  54. typedef int ptrdiff_t;
  55. #define _PTRDIFF_T_DEFINED
  56. #endif 
  57.  
  58. #ifndef _SIZE_T_DEFINED
  59. typedef unsigned int size_t;
  60. #define _SIZE_T_DEFINED
  61. #endif 
  62.  
  63. #ifndef _WCHAR_T_DEFINED
  64. typedef unsigned short wchar_t;
  65. #define _WCHAR_T_DEFINED
  66. #endif 
  67.  
  68.  
  69. #ifdef _MT
  70. /* define pointer to thread id value */
  71.  
  72. extern int __far *_threadid;
  73. #endif 
  74.  
  75. #ifdef __cplusplus
  76. }
  77. #endif 
  78.  
  79. #define _INC_STDDEF
  80. #endif 
  81.