home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / _STDDEF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  2.5 KB  |  130 lines

  1. /*  _stddef.h
  2.  
  3.     multi-includable Definitions for common types, and NULL
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 9.5
  9.  *
  10.  *      Copyright (c) 1987, 1999 by Inprise Corporation
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. /* $Revision:   9.1  $ */
  16.  
  17. #ifndef ___STDDEF_H
  18. #define ___STDDEF_H
  19.  
  20. #if !defined(___DEFS_H)
  21. #include <_defs.h>
  22. #endif
  23.  
  24. #ifndef NULL
  25. #include <_null.h>
  26. #endif
  27.  
  28. #ifdef __cplusplus
  29. namespace std {
  30. #endif /* __cplusplus */
  31.  
  32. /* Define __STD to expand to std:: or nothing depending on being in C++. */
  33. #ifdef __cplusplus
  34. #  define __STD std::
  35. #else
  36. #  define __STD
  37. #endif
  38.  
  39. /*
  40.    Define the size_t type in the std namespace if in C++ or globally if in C.
  41.    If we're in C++, make the _SIZE_T macro expand to std::size_t
  42. */
  43.  
  44. #if !defined(_SIZE_T) && !defined(_SIZE_T_DEFINED)
  45. #  define _SIZE_T_DEFINED
  46.    typedef unsigned int size_t;
  47. #  if defined(__cplusplus)
  48. #    define _SIZE_T std::size_t
  49. #  else
  50. #    define _SIZE_T size_t
  51. #  endif
  52. #endif
  53.  
  54.  
  55. #if !defined(RC_INVOKED)
  56.  
  57. #if defined(__STDC__)
  58. #pragma warn -nak
  59. #endif
  60.  
  61. #endif  /* !RC_INVOKED */
  62.  
  63. #ifndef _PTRDIFF_T
  64. #define _PTRDIFF_T
  65. typedef int     ptrdiff_t;
  66. #endif
  67.  
  68.  
  69. #define offsetof( s_name, m_name )  (_SIZE_T)&(((s_name _FAR *)0)->m_name)
  70.  
  71. #ifndef __cplusplus
  72. #if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
  73. #define _WCHAR_T
  74. #define _WCHAR_T_DEFINED  /* For WINDOWS.H */
  75. typedef unsigned short wchar_t;
  76. #endif
  77. #endif
  78.  
  79. /*
  80.    Define the wint_t type in the std namespace if in C++ or globally if in C.
  81.    If we're in C++, make the _WINT_T macro expand to std::wint_t
  82. */
  83.  
  84. #if !defined(_WINT_T)
  85. typedef wchar_t wint_t;
  86. #  ifdef __cplusplus
  87. #    define _WINT_T std::wint_t
  88. #  else
  89. #    define _WINT_T wint_t
  90. #  endif
  91. #endif
  92.  
  93. #ifndef _WCTYPE_T_DEFINED
  94. typedef wchar_t wctype_t;
  95. #define _WCTYPE_T_DEFINED
  96. #endif
  97.  
  98. #ifdef __cplusplus
  99. extern "C" {
  100. #endif
  101. extern unsigned long _RTLENTRY _EXPFUNC __threadid(void);
  102. #define _threadid (__threadid())
  103.  
  104. #ifdef  __cplusplus
  105. }
  106. #endif
  107.  
  108. #if !defined(RC_INVOKED)
  109.  
  110. #if defined(__STDC__)
  111. #pragma warn .nak
  112. #endif
  113.  
  114. #endif  /* !RC_INVOKED */
  115.  
  116. #ifdef __cplusplus
  117. } // std
  118. #endif /* __cplusplus */
  119.  
  120. #endif  /* __STDDEF_H */
  121.  
  122. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(___STDDEF_H_USING_LIST)
  123. #define ___STDDEF_H_USING_LIST
  124.      using std::ptrdiff_t;
  125.      using std::__threadid;
  126.      using std::size_t;
  127.      using std::wint_t;
  128.      using std::wctype_t;
  129. #endif /* __USING_CNAME__ */
  130.