Source code of Windows XP (NT5)
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.

241 lines
5.1 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. #include <use_ansi.h>
  23. #ifndef _VC6SP2
  24. #define _VC6SP2 0 /* define as 1 to fix linker errors with V6.0 SP2 */
  25. #endif
  26. /* Define _CRTIMP2 */
  27. #ifndef _CRTIMP2
  28. #ifdef CRTDLL2
  29. #define _CRTIMP2 __declspec(dllexport)
  30. #else /* ndef CRTDLL2 */
  31. #if defined(_DLL) && !defined(_STATIC_CPPLIB)
  32. #define _CRTIMP2 __declspec(dllimport)
  33. #else /* ndef _DLL && !STATIC_CPPLIB */
  34. #define _CRTIMP2
  35. #endif /* _DLL && !STATIC_CPPLIB */
  36. #endif /* CRTDLL2 */
  37. #endif /* _CRTIMP2 */
  38. #ifndef _INTERNAL_IFSTRIP_
  39. /* These functions are for enabling STATIC_CPPLIB functionality */
  40. #define _cpp_stdin (&(__iob_func())[0])
  41. #define _cpp_stdout (&(__iob_func())[1])
  42. #define _cpp_stderr (&(__iob_func())[2])
  43. #define _cpp_isleadbyte(c) (__pctype_func()[(unsigned char)(c)] & _LEADBYTE)
  44. #endif
  45. #if defined(_DLL) && !defined(_STATIC_CPPLIB)
  46. #define _DLL_CPPLIB
  47. #endif
  48. #ifndef _INTERNAL_IFSTRIP_
  49. /* Define _CRTBLD_NATIVE_WCHAR_T */
  50. #if defined(_CRTBLD) && defined(__cplusplus)
  51. #ifndef _NATIVE_WCHAR_T_DEFINED
  52. #error Native wchar_t must be defined
  53. #else
  54. #define _CRTBLD_NATIVE_WCHAR_T
  55. #endif /* _NATIVE_WCHAR_T_DEFINED */
  56. #endif /* defined(_CRTBLD) && defined(__cplusplus) */
  57. #endif
  58. #if (1300 <= _MSC_VER)
  59. #define _DEPRECATED __declspec(deprecated)
  60. #else
  61. #define _DEPRECATED
  62. #endif
  63. /* NAMESPACE */
  64. #if defined(__cplusplus)
  65. #define _STD std::
  66. #define _STD_BEGIN namespace std {
  67. #define _STD_END }
  68. #define _CSTD ::
  69. #define _C_STD_BEGIN /* match _STD_BEGIN/END if *.c compiled as C++ */
  70. #define _C_STD_END
  71. #define _C_LIB_DECL extern "C" { /* C has extern "C" linkage */
  72. #define _END_C_LIB_DECL }
  73. #define _EXTERN_C extern "C" {
  74. #define _END_EXTERN_C }
  75. #else /* __cplusplus */
  76. #define _STD
  77. #define _STD_BEGIN
  78. #define _STD_END
  79. #define _CSTD
  80. #define _C_STD_BEGIN
  81. #define _C_STD_END
  82. #define _C_LIB_DECL
  83. #define _END_C_LIB_DECL
  84. #define _EXTERN_C
  85. #define _END_EXTERN_C
  86. #endif /* __cplusplus */
  87. #define _Restrict restrict
  88. #ifdef __cplusplus
  89. _STD_BEGIN
  90. typedef bool _Bool;
  91. _STD_END
  92. #endif /* __cplusplus */
  93. /* VC++ COMPILER PARAMETERS */
  94. #define _LONGLONG __int64
  95. #define _ULONGLONG unsigned __int64
  96. #define _LLONG_MAX 0x7fffffffffffffff
  97. #define _ULLONG_MAX 0xffffffffffffffff
  98. /* INTEGER PROPERTIES */
  99. #define _C2 1 /* 0 if not 2's complement */
  100. #define _MAX_EXP_DIG 8 /* for parsing numerics */
  101. #define _MAX_INT_DIG 32
  102. #define _MAX_SIG_DIG 36
  103. typedef _LONGLONG _Longlong;
  104. typedef _ULONGLONG _ULonglong;
  105. /* STDIO PROPERTIES */
  106. #define _Filet _iobuf
  107. #ifndef _FPOS_T_DEFINED
  108. #define _FPOSOFF(fp) ((long)(fp))
  109. #endif /* _FPOS_T_DEFINED */
  110. #define _IOBASE _base
  111. #define _IOPTR _ptr
  112. #define _IOCNT _cnt
  113. /* MULTITHREAD PROPERTIES */
  114. /* LOCK MACROS */
  115. #define _LOCK_LOCALE 0
  116. #define _LOCK_MALLOC 1
  117. #define _LOCK_STREAM 2
  118. #define _MAX_LOCK 3 /* one more than highest lock number */
  119. #ifdef __cplusplus
  120. _STD_BEGIN
  121. // CLASS _Lockit
  122. class _CRTIMP2 _Lockit
  123. { // lock while object in existence -- MUST NEST
  124. public:
  125. #if _MULTI_THREAD
  126. explicit _Lockit(); // set default lock
  127. explicit _Lockit(int); // set the lock
  128. ~_Lockit(); // clear the lock
  129. private:
  130. _Lockit(const _Lockit&); // not defined
  131. _Lockit& operator=(const _Lockit&); // not defined
  132. int _Locktype;
  133. #else /* _MULTI_THREAD */
  134. #define _LOCKIT(x)
  135. explicit _Lockit()
  136. { // do nothing
  137. }
  138. explicit _Lockit(int)
  139. { // do nothing
  140. }
  141. ~_Lockit()
  142. { // do nothing
  143. }
  144. #endif /* _MULTI_THREAD */
  145. };
  146. class _CRTIMP2 _Mutex
  147. { // lock under program control
  148. public:
  149. #if _MULTI_THREAD
  150. _Mutex();
  151. ~_Mutex();
  152. void _Lock();
  153. void _Unlock();
  154. private:
  155. _Mutex(const _Mutex&); // not defined
  156. _Mutex& operator=(const _Mutex&); // not defined
  157. void *_Mtx;
  158. #else /* _MULTI_THREAD */
  159. void _Lock()
  160. { // do nothing
  161. }
  162. void _Unlock()
  163. { // do nothing
  164. }
  165. #endif /* _MULTI_THREAD */
  166. };
  167. class _Init_locks
  168. { // initialize mutexes
  169. public:
  170. #if _MULTI_THREAD
  171. _Init_locks();
  172. ~_Init_locks();
  173. #else /* _MULTI_THREAD */
  174. _Init_locks()
  175. { // do nothing
  176. }
  177. ~_Init_locks()
  178. { // do nothing
  179. }
  180. #endif /* _MULTI_THREAD */
  181. };
  182. _STD_END
  183. #endif /* __cplusplus */
  184. /* MISCELLANEOUS MACROS AND TYPES */
  185. _C_STD_BEGIN
  186. _EXTERN_C
  187. _CRTIMP2 void __cdecl _Atexit(void (__cdecl *)(void));
  188. _END_EXTERN_C
  189. typedef int _Mbstatet;
  190. #define _ATEXIT_T void
  191. #define _Mbstinit(x) mbstate_t x = {0}
  192. _C_STD_END
  193. #endif /* _YVALS */
  194. /*
  195. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  196. * Consult your license regarding permissions and restrictions.
  197. V3.10:0009 */