home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c040 / 6.ddi / INCLUDE / STDDEF.H$ / STDDEF.bin
Encoding:
Text File  |  1989-08-31  |  1.2 KB  |  66 lines

  1. /***
  2. *stddef.h - definitions/declarations for common constants, types, variables
  3. *
  4. *    Copyright (c) 1985-1990, 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. #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 the NULL pointer value and the offsetof() macro */
  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. #define offsetof(s,m)    (size_t)&(((s *)0)->m)
  36.  
  37.  
  38. /* declare reference to errno */
  39.  
  40. #ifdef    _MT
  41. extern int _far * _cdecl _far volatile _errno(void);
  42. #define errno    (*_errno())
  43. #else
  44. extern int _near _cdecl volatile errno;
  45. #endif
  46.  
  47.  
  48. /* define the implementation dependent size types */
  49.  
  50. #ifndef _PTRDIFF_T_DEFINED
  51. typedef int ptrdiff_t;
  52. #define _PTRDIFF_T_DEFINED
  53. #endif
  54.  
  55. #ifndef _SIZE_T_DEFINED
  56. typedef unsigned int size_t;
  57. #define _SIZE_T_DEFINED
  58. #endif
  59.  
  60.  
  61. #ifdef _MT
  62. /* define pointer to thread id value */
  63.  
  64. extern int _far *_threadid;
  65. #endif
  66.