home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / _stddef.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  2.6 KB  |  137 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 10.0
  9.  *
  10.  *      Copyright (c) 1987, 2000 by Inprise Corporation
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. /* $Revision:   9.2  $ */
  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. /* Full locale support is on by default now.  To get the previous behavior,
  29.    define __SIMPLE_LOCALES__
  30. */
  31. #ifndef __SIMPLE_LOCALES__
  32. #define __USELOCALES__
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. namespace std {
  37. #endif /* __cplusplus */
  38.  
  39. /* Define __STD to expand to std:: or nothing depending on being in C++. */
  40. #ifdef __cplusplus
  41. #  define __STD std::
  42. #else
  43. #  define __STD
  44. #endif
  45.  
  46. /*
  47.    Define the size_t type in the std namespace if in C++ or globally if in C.
  48.    If we're in C++, make the _SIZE_T macro expand to std::size_t
  49. */
  50.  
  51. #if !defined(_SIZE_T) && !defined(_SIZE_T_DEFINED)
  52. #  define _SIZE_T_DEFINED
  53.    typedef unsigned int size_t;
  54. #  if defined(__cplusplus)
  55. #    define _SIZE_T std::size_t
  56. #  else
  57. #    define _SIZE_T size_t
  58. #  endif
  59. #endif
  60.  
  61.  
  62. #if !defined(RC_INVOKED)
  63.  
  64. #if defined(__STDC__)
  65. #pragma warn -nak
  66. #endif
  67.  
  68. #endif  /* !RC_INVOKED */
  69.  
  70. #ifndef _PTRDIFF_T
  71. #define _PTRDIFF_T
  72. typedef int     ptrdiff_t;
  73. #endif
  74.  
  75.  
  76. #define offsetof( s_name, m_name )  (_SIZE_T)&(((s_name _FAR *)0)->m_name)
  77.  
  78. #ifndef __cplusplus
  79. #if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
  80. #define _WCHAR_T
  81. #define _WCHAR_T_DEFINED  /* For WINDOWS.H */
  82. typedef unsigned short wchar_t;
  83. #endif
  84. #endif
  85.  
  86. /*
  87.    Define the wint_t type in the std namespace if in C++ or globally if in C.
  88.    If we're in C++, make the _WINT_T macro expand to std::wint_t
  89. */
  90.  
  91. #if !defined(_WINT_T)
  92. typedef wchar_t wint_t;
  93. #  ifdef __cplusplus
  94. #    define _WINT_T std::wint_t
  95. #  else
  96. #    define _WINT_T wint_t
  97. #  endif
  98. #endif
  99.  
  100. #ifndef _WCTYPE_T_DEFINED
  101. typedef wchar_t wctype_t;
  102. #define _WCTYPE_T_DEFINED
  103. #endif
  104.  
  105. #ifdef __cplusplus
  106. extern "C" {
  107. #endif
  108. extern unsigned long _RTLENTRY _EXPFUNC __threadid(void);
  109. #define _threadid (__threadid())
  110.  
  111. #ifdef  __cplusplus
  112. }
  113. #endif
  114.  
  115. #if !defined(RC_INVOKED)
  116.  
  117. #if defined(__STDC__)
  118. #pragma warn .nak
  119. #endif
  120.  
  121. #endif  /* !RC_INVOKED */
  122.  
  123. #ifdef __cplusplus
  124. } // std
  125. #endif /* __cplusplus */
  126.  
  127. #endif  /* __STDDEF_H */
  128.  
  129. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(___STDDEF_H_USING_LIST)
  130. #define ___STDDEF_H_USING_LIST
  131.      using std::ptrdiff_t;
  132.      using std::__threadid;
  133.      using std::size_t;
  134.      using std::wint_t;
  135.      using std::wctype_t;
  136. #endif /* __USING_CNAME__ */
  137.