Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

222 lines
4.7 KiB

  1. /* yvals.h values header for Microsoft C/C++ */
  2. #pragma once
  3. #ifndef _YVALS
  4. #define _YVALS
  5. #define _CPPLIB_VER 310
  6. /* NAMING PROPERTIES */
  7. #define _WIN32_C_LIB 1
  8. /* THREAD AND LOCALE CONTROL */
  9. #define _MULTI_THREAD _MT /* nontrivial locks if multithreaded */
  10. #define _GLOBAL_LOCALE 0 /* 0 for per-thread locales, 1 for shared */
  11. /* THREAD-LOCAL STORAGE */
  12. #define _COMPILER_TLS 1 /* 1 if compiler supports TLS directly */
  13. #if _MULTI_THREAD
  14. #define _TLS_QUAL __declspec(thread) /* TLS qualifier, if any */
  15. #else
  16. #define _TLS_QUAL
  17. #endif
  18. #ifndef _HAS_EXCEPTIONS
  19. #define _HAS_EXCEPTIONS 1 /* predefine as 0 to disable exceptions */
  20. #endif
  21. #define _HAS_TEMPLATE_PARTIAL_ORDERING 0
  22. #define _HAS_PARTIAL_SPECIALIZATION (1301 <= _MSC_VER)
  23. #include <use_ansi.h>
  24. #ifndef _VC6SP2
  25. #define _VC6SP2 0 /* define as 1 to fix linker errors with V6.0 SP2 */
  26. #endif
  27. /* Define _CRTIMP2 */
  28. #ifndef _CRTIMP2
  29. #if defined(_DLL) && !defined(_STATIC_CPPLIB)
  30. #define _CRTIMP2 __declspec(dllimport)
  31. #else /* ndef _DLL && !STATIC_CPPLIB */
  32. #define _CRTIMP2
  33. #endif /* _DLL && !STATIC_CPPLIB */
  34. #endif /* _CRTIMP2 */
  35. #if defined(_DLL) && !defined(_STATIC_CPPLIB)
  36. #define _DLL_CPPLIB
  37. #endif
  38. #if (1300 <= _MSC_VER)
  39. #define _DEPRECATED __declspec(deprecated)
  40. #else
  41. #define _DEPRECATED
  42. #endif
  43. /* NAMESPACE */
  44. #if defined(__cplusplus)
  45. #define _STD std::
  46. #define _STD_BEGIN namespace std {
  47. #define _STD_END }
  48. #define _CSTD ::
  49. #define _C_STD_BEGIN /* match _STD_BEGIN/END if *.c compiled as C++ */
  50. #define _C_STD_END
  51. #define _C_LIB_DECL extern "C" { /* C has extern "C" linkage */
  52. #define _END_C_LIB_DECL }
  53. #define _EXTERN_C extern "C" {
  54. #define _END_EXTERN_C }
  55. #else /* __cplusplus */
  56. #define _STD
  57. #define _STD_BEGIN
  58. #define _STD_END
  59. #define _CSTD
  60. #define _C_STD_BEGIN
  61. #define _C_STD_END
  62. #define _C_LIB_DECL
  63. #define _END_C_LIB_DECL
  64. #define _EXTERN_C
  65. #define _END_EXTERN_C
  66. #endif /* __cplusplus */
  67. #define _Restrict restrict
  68. #ifdef __cplusplus
  69. _STD_BEGIN
  70. typedef bool _Bool;
  71. _STD_END
  72. #endif /* __cplusplus */
  73. /* VC++ COMPILER PARAMETERS */
  74. #define _LONGLONG __int64
  75. #define _ULONGLONG unsigned __int64
  76. #define _LLONG_MAX 0x7fffffffffffffff
  77. #define _ULLONG_MAX 0xffffffffffffffff
  78. /* INTEGER PROPERTIES */
  79. #define _C2 1 /* 0 if not 2's complement */
  80. #define _MAX_EXP_DIG 8 /* for parsing numerics */
  81. #define _MAX_INT_DIG 32
  82. #define _MAX_SIG_DIG 36
  83. typedef _LONGLONG _Longlong;
  84. typedef _ULONGLONG _ULonglong;
  85. /* STDIO PROPERTIES */
  86. #define _Filet _iobuf
  87. #ifndef _FPOS_T_DEFINED
  88. #define _FPOSOFF(fp) ((long)(fp))
  89. #endif /* _FPOS_T_DEFINED */
  90. #define _IOBASE _base
  91. #define _IOPTR _ptr
  92. #define _IOCNT _cnt
  93. /* MULTITHREAD PROPERTIES */
  94. /* LOCK MACROS */
  95. #define _LOCK_LOCALE 0
  96. #define _LOCK_MALLOC 1
  97. #define _LOCK_STREAM 2
  98. #define _MAX_LOCK 3 /* one more than highest lock number */
  99. #ifdef __cplusplus
  100. _STD_BEGIN
  101. // CLASS _Lockit
  102. class _CRTIMP2 _Lockit
  103. { // lock while object in existence -- MUST NEST
  104. public:
  105. #if _MULTI_THREAD
  106. explicit _Lockit(); // set default lock
  107. explicit _Lockit(int); // set the lock
  108. ~_Lockit(); // clear the lock
  109. private:
  110. _Lockit(const _Lockit&); // not defined
  111. _Lockit& operator=(const _Lockit&); // not defined
  112. int _Locktype;
  113. #else /* _MULTI_THREAD */
  114. #define _LOCKIT(x)
  115. explicit _Lockit()
  116. { // do nothing
  117. }
  118. explicit _Lockit(int)
  119. { // do nothing
  120. }
  121. ~_Lockit()
  122. { // do nothing
  123. }
  124. #endif /* _MULTI_THREAD */
  125. };
  126. class _CRTIMP2 _Mutex
  127. { // lock under program control
  128. public:
  129. #if _MULTI_THREAD
  130. _Mutex();
  131. ~_Mutex();
  132. void _Lock();
  133. void _Unlock();
  134. private:
  135. _Mutex(const _Mutex&); // not defined
  136. _Mutex& operator=(const _Mutex&); // not defined
  137. void *_Mtx;
  138. #else /* _MULTI_THREAD */
  139. void _Lock()
  140. { // do nothing
  141. }
  142. void _Unlock()
  143. { // do nothing
  144. }
  145. #endif /* _MULTI_THREAD */
  146. };
  147. class _Init_locks
  148. { // initialize mutexes
  149. public:
  150. #if _MULTI_THREAD
  151. _Init_locks();
  152. ~_Init_locks();
  153. #else /* _MULTI_THREAD */
  154. _Init_locks()
  155. { // do nothing
  156. }
  157. ~_Init_locks()
  158. { // do nothing
  159. }
  160. #endif /* _MULTI_THREAD */
  161. };
  162. _STD_END
  163. #endif /* __cplusplus */
  164. /* MISCELLANEOUS MACROS AND TYPES */
  165. _C_STD_BEGIN
  166. _EXTERN_C
  167. _CRTIMP2 void __cdecl _Atexit(void (__cdecl *)(void));
  168. _END_EXTERN_C
  169. typedef int _Mbstatet;
  170. #define _ATEXIT_T void
  171. #define _Mbstinit(x) mbstate_t x = {0}
  172. _C_STD_END
  173. #endif /* _YVALS */
  174. /*
  175. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  176. * Consult your license regarding permissions and restrictions.
  177. V3.10:0009 */