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.

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