/External/gccxml/share/gccxml-0.9/Vc10/Include/yvals.h

https://github.com/KarimLUCCIN/SharpDX · C Header · 907 lines · 686 code · 170 blank · 51 comment · 58 complexity · 68ff29af7cbafc92273eb698bce7e66c MD5 · raw file

  1. /* yvals.h values header for Microsoft C/C++ */
  2. #pragma once
  3. #ifndef _YVALS
  4. #define _YVALS
  5. #include <crtdefs.h>
  6. #pragma pack(push,_CRT_PACKING)
  7. #define _CPPLIB_VER 520
  8. #if 1 // gccxml cannot provide these builtins until we use the 4.3 parser
  9. #define __is_union(X) gccxml_does_not_yet_support_tr1_type_traits
  10. #define __is_class(X) gccxml_does_not_yet_support_tr1_type_traits
  11. #define __is_enum(X) gccxml_does_not_yet_support_tr1_type_traits
  12. #define __is_pod(X) gccxml_does_not_yet_support_tr1_type_traits
  13. #define __is_empty(X) gccxml_does_not_yet_support_tr1_type_traits
  14. #define __is_polymorphic(X) gccxml_does_not_yet_support_tr1_type_traits
  15. #define __is_abstract(X) gccxml_does_not_yet_support_tr1_type_traits
  16. #define __is_convertible_to(X,Y) gccxml_does_not_yet_support_tr1_type_traits
  17. #define __has_trivial_constructor(X) gccxml_does_not_yet_support_tr1_type_traits
  18. #define __has_trivial_copy(X) gccxml_does_not_yet_support_tr1_type_traits
  19. #define __has_trivial_assign(X) gccxml_does_not_yet_support_tr1_type_traits
  20. #define __has_trivial_destructor(X) gccxml_does_not_yet_support_tr1_type_traits
  21. #define __has_nothrow_constructor(X) gccxml_does_not_yet_support_tr1_type_traits
  22. #define __has_nothrow_copy(X) gccxml_does_not_yet_support_tr1_type_traits
  23. #define __has_nothrow_assign(X) gccxml_does_not_yet_support_tr1_type_traits
  24. #define __has_virtual_destructor(X) gccxml_does_not_yet_support_tr1_type_traits
  25. #endif
  26. #define _ALLOW_KEYWORD_MACROS // TRANSITION
  27. #ifndef _ALLOW_KEYWORD_MACROS
  28. #include <xkeycheck.h>
  29. #endif /* _ALLOW_KEYWORD_MACROS */
  30. #ifndef _HAS_CPP0X
  31. #define _HAS_CPP0X 1
  32. #endif
  33. #define _HAS_TR1 1 /* enable TR1 extensions */
  34. /* Note on use of "deprecate":
  35. * Various places in this header and other headers use __declspec(deprecate) or macros that have the term DEPRECATE in them.
  36. * We use deprecate here ONLY to signal the compiler to emit a warning about these items. The use of deprecate
  37. * should NOT be taken to imply that any standard committee has deprecated these functions from the relevant standards.
  38. * In fact, these functions are NOT deprecated from the standard.
  39. *
  40. * Full details can be found in our documentation by searching for "Checked Iterators".
  41. */
  42. #define __PURE_APPDOMAIN_GLOBAL
  43. #ifndef __CRTDECL
  44. #if defined(_M_CEE_PURE) || defined(MRTDLL)
  45. #define __CRTDECL __clrcall
  46. #else
  47. #define __CRTDECL __cdecl
  48. #endif
  49. #endif
  50. #ifndef __CLR_OR_THIS_CALL
  51. #if defined(MRTDLL) || defined(_M_CEE_PURE)
  52. #define __CLR_OR_THIS_CALL __clrcall
  53. #else
  54. #define __CLR_OR_THIS_CALL
  55. #endif
  56. #endif
  57. #ifndef __CLRCALL_OR_CDECL
  58. #if defined(MRTDLL) || defined(_M_CEE_PURE)
  59. #define __CLRCALL_OR_CDECL __clrcall
  60. #else
  61. #define __CLRCALL_OR_CDECL __cdecl
  62. #endif
  63. #endif
  64. #ifndef __CLRCALL_PURE_OR_CDECL
  65. #if defined(_M_CEE_PURE)
  66. #define __CLRCALL_PURE_OR_CDECL __clrcall
  67. #else
  68. #define __CLRCALL_PURE_OR_CDECL __cdecl
  69. #endif
  70. #endif
  71. /* CURRENT DLL NAMES */
  72. #ifndef _CRT_MSVCP_CURRENT
  73. #ifdef _DEBUG
  74. #define _CRT_MSVCP_CURRENT "MSVCP100D.dll"
  75. #else
  76. #define _CRT_MSVCP_CURRENT "MSVCP100.dll"
  77. #endif
  78. #endif
  79. /* NAMING PROPERTIES */
  80. #define _WIN32_C_LIB 1
  81. /* THREAD AND LOCALE CONTROL */
  82. #define _MULTI_THREAD 1 /* nontrivial locks if multithreaded */
  83. #define _IOSTREAM_OP_LOCKS 1 /* lock iostream operations */
  84. #define _GLOBAL_LOCALE 0 /* 0 for per-thread locales, 1 for shared */
  85. /* THREAD-LOCAL STORAGE */
  86. #define _COMPILER_TLS 1 /* 1 if compiler supports TLS directly */
  87. #if _MULTI_THREAD
  88. #define _TLS_QUAL __declspec(thread) /* TLS qualifier, if any */
  89. #else /* _MULTI_THREAD */
  90. #define _TLS_QUAL
  91. #endif /* _MULTI_THREAD */
  92. #ifndef _HAS_EXCEPTIONS
  93. #define _HAS_EXCEPTIONS 1 /* predefine as 0 to disable exceptions */
  94. #endif /* _HAS_EXCEPTIONS */
  95. #ifndef _HAS_STRICT_CONFORMANCE
  96. #define _HAS_STRICT_CONFORMANCE 0
  97. #endif /* _HAS_STRICT_CONFORMANCE */
  98. #ifndef _HAS_TR1_IMPORTS
  99. #define _HAS_TR1_IMPORTS _HAS_CPP0X
  100. #endif
  101. #define _GLOBAL_USING 1
  102. #ifdef _ITERATOR_DEBUG_LEVEL /* A. _ITERATOR_DEBUG_LEVEL is already defined. */
  103. /* A1. Validate _ITERATOR_DEBUG_LEVEL. */
  104. #if _ITERATOR_DEBUG_LEVEL > 2 && defined(_DEBUG)
  105. #error _ITERATOR_DEBUG_LEVEL > 2 is not supported in debug mode.
  106. #elif _ITERATOR_DEBUG_LEVEL > 1 && !defined(_DEBUG)
  107. #error _ITERATOR_DEBUG_LEVEL > 1 is not supported in release mode.
  108. #endif
  109. /* A2. Inspect _HAS_ITERATOR_DEBUGGING. */
  110. #ifdef _HAS_ITERATOR_DEBUGGING /* A2i. _HAS_ITERATOR_DEBUGGING is already defined, validate it. */
  111. #if _ITERATOR_DEBUG_LEVEL == 2 && _HAS_ITERATOR_DEBUGGING != 1
  112. #error _ITERATOR_DEBUG_LEVEL == 2 must imply _HAS_ITERATOR_DEBUGGING == 1 .
  113. #elif _ITERATOR_DEBUG_LEVEL < 2 && _HAS_ITERATOR_DEBUGGING != 0
  114. #error _ITERATOR_DEBUG_LEVEL < 2 must imply _HAS_ITERATOR_DEBUGGING == 0 .
  115. #endif
  116. #else /* A2ii. _HAS_ITERATOR_DEBUGGING is not yet defined, derive it. */
  117. #if _ITERATOR_DEBUG_LEVEL == 2
  118. #define _HAS_ITERATOR_DEBUGGING 1
  119. #else
  120. #define _HAS_ITERATOR_DEBUGGING 0
  121. #endif
  122. #endif /* _HAS_ITERATOR_DEBUGGING */
  123. /* A3. Inspect _SECURE_SCL. */
  124. #ifdef _SECURE_SCL /* A3i. _SECURE_SCL is already defined, validate it. */
  125. #if _ITERATOR_DEBUG_LEVEL > 0 && _SECURE_SCL != 1
  126. #error _ITERATOR_DEBUG_LEVEL > 0 must imply _SECURE_SCL == 1 .
  127. #elif _ITERATOR_DEBUG_LEVEL == 0 && _SECURE_SCL != 0
  128. #error _ITERATOR_DEBUG_LEVEL == 0 must imply _SECURE_SCL == 0 .
  129. #endif
  130. #else /* A3ii. _SECURE_SCL is not yet defined, derive it. */
  131. #if _ITERATOR_DEBUG_LEVEL > 0
  132. #define _SECURE_SCL 1
  133. #else
  134. #define _SECURE_SCL 0
  135. #endif
  136. #endif /* _SECURE_SCL */
  137. #else /* B. _ITERATOR_DEBUG_LEVEL is not yet defined. */
  138. /* B1. Inspect _HAS_ITERATOR_DEBUGGING. */
  139. #ifdef _HAS_ITERATOR_DEBUGGING /* B1i. _HAS_ITERATOR_DEBUGGING is already defined, validate it. */
  140. #if _HAS_ITERATOR_DEBUGGING > 1
  141. #error _HAS_ITERATOR_DEBUGGING must be either 0 or 1 .
  142. #elif _HAS_ITERATOR_DEBUGGING == 1 && !defined(_DEBUG)
  143. #error _HAS_ITERATOR_DEBUGGING == 1 is not supported in release mode.
  144. #endif
  145. #else /* B1ii. _HAS_ITERATOR_DEBUGGING is not yet defined, default it. */
  146. #ifdef _DEBUG
  147. #define _HAS_ITERATOR_DEBUGGING 1
  148. #else
  149. #define _HAS_ITERATOR_DEBUGGING 0
  150. #endif
  151. #endif /* _HAS_ITERATOR_DEBUGGING */
  152. /* B2. Inspect _SECURE_SCL. */
  153. #ifdef _SECURE_SCL /* B2i. _SECURE_SCL is already defined, validate it. */
  154. #if _SECURE_SCL > 1
  155. #error _SECURE_SCL must be either 0 or 1 .
  156. #endif
  157. #else /* B2ii. _SECURE_SCL is not yet defined, default it. */
  158. #if _HAS_ITERATOR_DEBUGGING == 1
  159. #define _SECURE_SCL 1
  160. #else
  161. #define _SECURE_SCL 0
  162. #endif
  163. #endif /* _SECURE_SCL */
  164. /* B3. Derive _ITERATOR_DEBUG_LEVEL. */
  165. #if _HAS_ITERATOR_DEBUGGING
  166. #define _ITERATOR_DEBUG_LEVEL 2
  167. #elif _SECURE_SCL
  168. #define _ITERATOR_DEBUG_LEVEL 1
  169. #else
  170. #define _ITERATOR_DEBUG_LEVEL 0
  171. #endif
  172. #endif /* _ITERATOR_DEBUG_LEVEL */
  173. #if defined(_CRTBLD) && defined(_DLL)
  174. #define _ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH
  175. #endif
  176. #ifdef __cplusplus
  177. #ifndef _ALLOW_MSC_VER_MISMATCH
  178. #pragma detect_mismatch("_MSC_VER", "1600")
  179. #endif /* _ALLOW_MSC_VER_MISMATCH */
  180. #ifndef _ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH
  181. #if _ITERATOR_DEBUG_LEVEL == 0
  182. #pragma detect_mismatch("_ITERATOR_DEBUG_LEVEL", "0")
  183. #elif _ITERATOR_DEBUG_LEVEL == 1
  184. #pragma detect_mismatch("_ITERATOR_DEBUG_LEVEL", "1")
  185. #elif _ITERATOR_DEBUG_LEVEL == 2
  186. #pragma detect_mismatch("_ITERATOR_DEBUG_LEVEL", "2")
  187. #else
  188. #error Unrecognized _ITERATOR_DEBUG_LEVEL value.
  189. #endif
  190. #endif /* _ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH */
  191. #endif /* __cplusplus */
  192. /* See note on use of deprecate at the top of this file */
  193. #if !defined(_SCL_SECURE_NO_WARNINGS) && defined(_SCL_SECURE_NO_DEPRECATE)
  194. #define _SCL_SECURE_NO_WARNINGS
  195. #endif
  196. #if !defined (_SECURE_SCL_DEPRECATE)
  197. #if defined(_SCL_SECURE_NO_WARNINGS)
  198. #define _SECURE_SCL_DEPRECATE 0
  199. #else
  200. #define _SECURE_SCL_DEPRECATE 1
  201. #endif
  202. #endif
  203. #if !defined (_SECURE_SCL_THROWS)
  204. #define _SECURE_SCL_THROWS 0
  205. #endif
  206. /* _SECURE_SCL switches: helper macros */
  207. /* See note on use of deprecate at the top of this file */
  208. #if _ITERATOR_DEBUG_LEVEL > 0 && _SECURE_SCL_DEPRECATE
  209. #define _SCL_INSECURE_DEPRECATE \
  210. _CRT_DEPRECATE_TEXT( \
  211. "Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. " \
  212. "To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'")
  213. #else
  214. #define _SCL_INSECURE_DEPRECATE
  215. #endif
  216. #ifndef _SCL_SECURE_INVALID_PARAMETER
  217. #define _SCL_SECURE_INVALID_PARAMETER(expr) _CRT_SECURE_INVALID_PARAMETER(expr)
  218. #endif
  219. /* ------------------------------------------------------------------------ */
  220. /* Forward declare these now because they are used as non-dependent names. */
  221. #ifdef _DEBUG
  222. #if !defined(_NATIVE_WCHAR_T_DEFINED) && defined(_M_CEE_PURE)
  223. extern "C++"
  224. #else
  225. extern "C"
  226. #endif
  227. _CRTIMP void __cdecl _invalid_parameter(_In_opt_z_ const wchar_t *, _In_opt_z_ const wchar_t *, _In_opt_z_ const wchar_t *, unsigned int, uintptr_t);
  228. #else /* _DEBUG */
  229. extern "C"
  230. _CRTIMP void __cdecl _invalid_parameter_noinfo(void);
  231. #endif /* def _DEBUG */
  232. /* ------------------------------------------------------------------------ */
  233. #if _SECURE_SCL_THROWS
  234. #ifndef _SILENCE_DEPRECATION_OF_SECURE_SCL_THROWS
  235. #include <crtwrn.h>
  236. #pragma push_macro("_SECURE_SCL_THROWS")
  237. #undef _SECURE_SCL_THROWS
  238. #pragma _CRT_WARNING( _DEPRECATE_SECURE_SCL_THROWS )
  239. #pragma pop_macro("_SECURE_SCL_THROWS")
  240. #endif /* _SILENCE_DEPRECATION_OF_SECURE_SCL_THROWS */
  241. #define _SCL_SECURE_INVALID_ARGUMENT_NO_ASSERT _STD _Xinvalid_argument("invalid argument")
  242. #define _SCL_SECURE_OUT_OF_RANGE_NO_ASSERT _STD _Xout_of_range("out of range")
  243. #else /* _SECURE_SCL_THROWS */
  244. #define _SCL_SECURE_INVALID_ARGUMENT_NO_ASSERT _SCL_SECURE_INVALID_PARAMETER("invalid argument")
  245. #define _SCL_SECURE_OUT_OF_RANGE_NO_ASSERT _SCL_SECURE_INVALID_PARAMETER("out of range")
  246. #endif /* _SECURE_SCL_THROWS */
  247. #define _SCL_SECURE_ALWAYS_VALIDATE(cond) \
  248. { \
  249. if (!(cond)) \
  250. { \
  251. _ASSERTE(#cond && 0); \
  252. _SCL_SECURE_INVALID_ARGUMENT_NO_ASSERT; \
  253. } \
  254. __analysis_assume(cond); \
  255. }
  256. #define _SCL_SECURE_ALWAYS_VALIDATE_RANGE(cond) \
  257. { \
  258. if (!(cond)) \
  259. { \
  260. _ASSERTE(#cond && 0); \
  261. _SCL_SECURE_OUT_OF_RANGE_NO_ASSERT; \
  262. } \
  263. __analysis_assume(cond); \
  264. }
  265. #define _SCL_SECURE_CRT_VALIDATE(cond, retvalue) \
  266. { \
  267. if (!(cond)) \
  268. { \
  269. _ASSERTE(#cond && 0); \
  270. _SCL_SECURE_INVALID_PARAMETER(cond); \
  271. return (retvalue); \
  272. } \
  273. }
  274. #if _ITERATOR_DEBUG_LEVEL > 0
  275. #define _SCL_SECURE_VALIDATE(cond) \
  276. { \
  277. if (!(cond)) \
  278. { \
  279. _ASSERTE(#cond && 0); \
  280. _SCL_SECURE_INVALID_ARGUMENT_NO_ASSERT; \
  281. } \
  282. __analysis_assume(cond); \
  283. }
  284. #define _SCL_SECURE_VALIDATE_RANGE(cond) \
  285. { \
  286. if (!(cond)) \
  287. { \
  288. _ASSERTE(#cond && 0); \
  289. _SCL_SECURE_OUT_OF_RANGE_NO_ASSERT; \
  290. } \
  291. __analysis_assume(cond); \
  292. }
  293. #define _SCL_SECURE_INVALID_ARGUMENT \
  294. { \
  295. _ASSERTE("Standard C++ Libraries Invalid Argument" && 0); \
  296. _SCL_SECURE_INVALID_ARGUMENT_NO_ASSERT; \
  297. }
  298. #define _SCL_SECURE_OUT_OF_RANGE \
  299. { \
  300. _ASSERTE("Standard C++ Libraries Out of Range" && 0); \
  301. _SCL_SECURE_OUT_OF_RANGE_NO_ASSERT; \
  302. }
  303. #else /* _ITERATOR_DEBUG_LEVEL > 0 */
  304. /* when users disable _SECURE_SCL to get performance, we don't want analysis warnings from SCL headers */
  305. #if _ITERATOR_DEBUG_LEVEL == 2
  306. #define _SCL_SECURE_VALIDATE(cond) __analysis_assume(cond)
  307. #define _SCL_SECURE_VALIDATE_RANGE(cond) __analysis_assume(cond)
  308. #else
  309. #define _SCL_SECURE_VALIDATE(cond)
  310. #define _SCL_SECURE_VALIDATE_RANGE(cond)
  311. #endif
  312. #define _SCL_SECURE_INVALID_ARGUMENT
  313. #define _SCL_SECURE_OUT_OF_RANGE
  314. #endif /* _ITERATOR_DEBUG_LEVEL > 0 */
  315. #if __STDC_WANT_SECURE_LIB__
  316. #define _CRT_SECURE_MEMCPY(dest, destsize, source, count) ::memcpy_s((dest), (destsize), (source), (count))
  317. #define _CRT_SECURE_MEMMOVE(dest, destsize, source, count) ::memmove_s((dest), (destsize), (source), (count))
  318. #define _CRT_SECURE_WMEMCPY(dest, destsize, source, count) ::wmemcpy_s((dest), (destsize), (source), (count))
  319. #define _CRT_SECURE_WMEMMOVE(dest, destsize, source, count) ::wmemmove_s((dest), (destsize), (source), (count))
  320. #else
  321. #define _CRT_SECURE_MEMCPY(dest, destsize, source, count) ::memcpy((dest), (source), (count))
  322. #define _CRT_SECURE_MEMMOVE(dest, destsize, source, count) ::memmove((dest), (source), (count))
  323. #define _CRT_SECURE_WMEMCPY(dest, destsize, source, count) ::wmemcpy((dest), (source), (count))
  324. #define _CRT_SECURE_WMEMMOVE(dest, destsize, source, count) ::wmemmove((dest), (source), (count))
  325. #endif
  326. #include <use_ansi.h>
  327. #if defined(_M_CEE) && defined(_STATIC_CPPLIB)
  328. #include <crtwrn.h>
  329. #pragma push_macro("_STATIC_CPPLIB")
  330. #undef _STATIC_CPPLIB
  331. #pragma _CRT_WARNING( _CLR_AND_STATIC_CPPLIB )
  332. #pragma pop_macro("_STATIC_CPPLIB")
  333. #endif
  334. #if defined(_DLL) && defined(_STATIC_CPPLIB) && !defined(_DISABLE_DEPRECATE_STATIC_CPPLIB)
  335. #include <crtwrn.h>
  336. #pragma push_macro("_STATIC_CPPLIB")
  337. #undef _STATIC_CPPLIB
  338. #pragma _CRT_WARNING( _DEPRECATE_STATIC_CPPLIB )
  339. #pragma pop_macro("_STATIC_CPPLIB")
  340. #endif
  341. /* Define _CRTIMP2 */
  342. #ifndef _CRTIMP2
  343. #if defined(_DLL) && !defined(_STATIC_CPPLIB)
  344. #define _CRTIMP2 __declspec(dllimport)
  345. #else /* ndef _DLL && !STATIC_CPPLIB */
  346. #define _CRTIMP2
  347. #endif /* _DLL && !STATIC_CPPLIB */
  348. #endif /* _CRTIMP2 */
  349. /* Define _CRTIMP2_NCEEPURE */
  350. #ifndef _CRTIMP2_NCEEPURE
  351. #if defined(_M_CEE_PURE)
  352. #define _CRTIMP2_NCEEPURE
  353. #else
  354. #define _CRTIMP2_NCEEPURE _CRTIMP2
  355. #endif
  356. #endif
  357. #ifndef _MRTIMP
  358. #define _MRTIMP __declspec(dllimport)
  359. #endif /* _MRTIMP */
  360. /* Define _MRTIMP2 */
  361. #ifndef _MRTIMP2
  362. #if defined(_DLL) && !defined(_STATIC_CPPLIB)
  363. #define _MRTIMP2 __declspec(dllimport)
  364. #else /* ndef _DLL && !STATIC_CPPLIB */
  365. #define _MRTIMP2
  366. #endif /* _DLL && !STATIC_CPPLIB */
  367. #endif /* _MRTIMP2 */
  368. #ifndef _MRTIMP2_PURE
  369. #if defined(_M_CEE_PURE)
  370. #define _MRTIMP2_PURE
  371. #else
  372. #define _MRTIMP2_PURE _MRTIMP2
  373. #endif
  374. #endif
  375. #ifndef _MRTIMP2_PURE_NPURE
  376. #if defined(_M_CEE_PURE)
  377. #define _MRTIMP2_PURE_NPURE
  378. #else
  379. #define _MRTIMP2_PURE_NPURE _MRTIMP2_NPURE
  380. #endif
  381. #endif
  382. /* Define _MRTIMP2_NPURE */
  383. #ifndef _MRTIMP2_NPURE
  384. #if defined(_DLL) && defined(_M_CEE_PURE)
  385. #define _MRTIMP2_NPURE __declspec(dllimport)
  386. #else
  387. #define _MRTIMP2_NPURE
  388. #endif
  389. #endif /* _MRTIMP2_NPURE */
  390. /* Define _MRTIMP2_NCEE */
  391. #ifndef _MRTIMP2_NCEE
  392. #if defined(_M_CEE)
  393. #define _MRTIMP2_NCEE
  394. #else
  395. #define _MRTIMP2_NCEE _MRTIMP2
  396. #endif
  397. #endif
  398. /* Define _MRTIMP2_NCEEPURE */
  399. #ifndef _MRTIMP2_NCEEPURE
  400. #if defined(_M_CEE_PURE)
  401. #define _MRTIMP2_NCEEPURE
  402. #else
  403. #define _MRTIMP2_NCEEPURE _MRTIMP2
  404. #endif
  405. #endif
  406. /* Define _MRTIMP2_NPURE_NCEEPURE */
  407. #ifndef _MRTIMP2_NPURE_NCEEPURE
  408. #if defined(_M_CEE_PURE)
  409. #define _MRTIMP2_NPURE_NCEEPURE
  410. #else
  411. #define _MRTIMP2_NPURE_NCEEPURE _MRTIMP2_NPURE
  412. #endif
  413. #endif
  414. #if defined(_DLL) && !defined(_STATIC_CPPLIB) && !defined(_M_CEE_PURE)
  415. #define _DLL_CPPLIB
  416. #endif
  417. #ifndef _CRTIMP2_PURE
  418. #ifdef _M_CEE_PURE
  419. #define _CRTIMP2_PURE
  420. #else
  421. #define _CRTIMP2_PURE _CRTIMP2
  422. #endif
  423. #endif
  424. #if !defined(_CRTDATA2)
  425. #define _CRTDATA2 _CRTIMP2
  426. #endif
  427. /* NAMESPACE */
  428. #if defined(__cplusplus)
  429. #define _STD_BEGIN namespace std {
  430. #define _STD_END }
  431. #define _STD ::std::
  432. /*
  433. We use the stdext (standard extension) namespace to contain extensions that are not part of the current standard
  434. */
  435. #define _STDEXT_BEGIN namespace stdext {
  436. #define _STDEXT_END }
  437. #define _STDEXT ::stdext::
  438. #ifdef _STD_USING
  439. #define _C_STD_BEGIN namespace std { /* only if *.c compiled as C++ */
  440. #define _C_STD_END }
  441. #define _CSTD ::std::
  442. #else /* _STD_USING */
  443. /* #define _GLOBAL_USING *.h in global namespace, c* imports to std */
  444. #define _C_STD_BEGIN
  445. #define _C_STD_END
  446. #define _CSTD ::
  447. #endif /* _STD_USING */
  448. #define _C_LIB_DECL extern "C" { /* C has extern "C" linkage */
  449. #define _END_C_LIB_DECL }
  450. #define _EXTERN_C extern "C" {
  451. #define _END_EXTERN_C }
  452. #else /* __cplusplus */
  453. #define _STD_BEGIN
  454. #define _STD_END
  455. #define _STD
  456. #define _C_STD_BEGIN
  457. #define _C_STD_END
  458. #define _CSTD
  459. #define _C_LIB_DECL
  460. #define _END_C_LIB_DECL
  461. #define _EXTERN_C
  462. #define _END_EXTERN_C
  463. #endif /* __cplusplus */
  464. #define _Restrict restrict
  465. #ifdef __cplusplus
  466. _STD_BEGIN
  467. typedef bool _Bool;
  468. _STD_END
  469. #endif /* __cplusplus */
  470. /* VC++ COMPILER PARAMETERS */
  471. #define _LONGLONG __int64
  472. #define _ULONGLONG unsigned __int64
  473. #define _LLONG_MAX 0x7fffffffffffffffi64
  474. #define _ULLONG_MAX 0xffffffffffffffffui64
  475. /* INTEGER PROPERTIES */
  476. #define _C2 1 /* 0 if not 2's complement */
  477. #define _MAX_EXP_DIG 8 /* for parsing numerics */
  478. #define _MAX_INT_DIG 32
  479. #define _MAX_SIG_DIG 36
  480. typedef _LONGLONG _Longlong;
  481. typedef _ULONGLONG _ULonglong;
  482. /* STDIO PROPERTIES */
  483. #define _Filet _iobuf
  484. #ifndef _FPOS_T_DEFINED
  485. #define _FPOSOFF(fp) ((long)(fp))
  486. #endif /* _FPOS_T_DEFINED */
  487. #define _IOBASE _base
  488. #define _IOPTR _ptr
  489. #define _IOCNT _cnt
  490. #ifndef _HAS_CHAR16_T_LANGUAGE_SUPPORT
  491. #define _HAS_CHAR16_T_LANGUAGE_SUPPORT 0
  492. #endif /* _HAS_CHAR16_T_LANGUAGE_SUPPORT */
  493. /* uchar PROPERTIES */
  494. #if _HAS_CHAR16_T_LANGUAGE_SUPPORT
  495. #else /* _HAS_CHAR16_T_LANGUAGE_SUPPORT */
  496. #if !defined(_CHAR16T)
  497. #define _CHAR16T
  498. typedef unsigned short char16_t;
  499. typedef unsigned int char32_t;
  500. #endif /* !defined(_CHAR16T) */
  501. #endif /* _HAS_CHAR16_T_LANGUAGE_SUPPORT */
  502. /* MULTITHREAD PROPERTIES */
  503. /* LOCK MACROS */
  504. #define _LOCK_LOCALE 0
  505. #define _LOCK_MALLOC 1
  506. #define _LOCK_STREAM 2
  507. #define _LOCK_DEBUG 3
  508. #define _MAX_LOCK 4 /* one more than highest lock number */
  509. #ifdef __cplusplus
  510. _STD_BEGIN
  511. enum _Uninitialized
  512. { // tag for suppressing initialization
  513. _Noinit
  514. };
  515. // CLASS _Lockit
  516. // warning 4412 is benign here
  517. #pragma warning(push)
  518. #pragma warning(disable:4412)
  519. class _CRTIMP2_PURE _Lockit
  520. { // lock while object in existence -- MUST NEST
  521. public:
  522. #if _MULTI_THREAD
  523. #if defined(_M_CEE_PURE) || defined(MRTDLL)
  524. __CLR_OR_THIS_CALL _Lockit()
  525. : _Locktype(0)
  526. { // default construct
  527. _Lockit_ctor(this);
  528. }
  529. explicit __CLR_OR_THIS_CALL _Lockit(int _Kind)
  530. { // set the lock
  531. _Lockit_ctor(this, _Kind);
  532. }
  533. __CLR_OR_THIS_CALL ~_Lockit()
  534. { // clear the lock
  535. _Lockit_dtor(this);
  536. }
  537. #else /* defined(_M_CEE_PURE) || defined(MRTDLL) */
  538. __thiscall _Lockit(); // default construct
  539. explicit __thiscall _Lockit(int); // set the lock
  540. __thiscall ~_Lockit(); // clear the lock
  541. #endif /* defined(_M_CEE_PURE) || defined(MRTDLL) */
  542. static _MRTIMP2_NPURE void __cdecl _Lockit_ctor(int);
  543. static _MRTIMP2_NPURE void __cdecl _Lockit_dtor(int);
  544. private:
  545. static _MRTIMP2_NPURE void __cdecl _Lockit_ctor(_Lockit *);
  546. static _MRTIMP2_NPURE void __cdecl _Lockit_ctor(_Lockit *, int);
  547. static _MRTIMP2_NPURE void __cdecl _Lockit_dtor(_Lockit *);
  548. #if 0 /* Disabled for gccxml */
  549. __CLR_OR_THIS_CALL _Lockit(const _Lockit&); // not defined
  550. _Lockit& __CLR_OR_THIS_CALL operator=(const _Lockit&); // not defined
  551. #endif /* Disabled for gccxml */
  552. int _Locktype;
  553. #else /* _MULTI_THREAD */
  554. _Lockit()
  555. { // do nothing
  556. }
  557. explicit _Lockit(int)
  558. { // do nothing
  559. }
  560. ~_Lockit()
  561. { // do nothing
  562. }
  563. #endif /* _MULTI_THREAD */
  564. };
  565. #ifdef _M_CEE
  566. class _CRTIMP2_PURE _EmptyLockit
  567. { // empty lock class used for bin compat
  568. public:
  569. #if _MULTI_THREAD
  570. private:
  571. int _Locktype;
  572. #endif /* _MULTI_THREAD */
  573. };
  574. #if defined(__cplusplus_cli)
  575. #define _M_CEE_FINALLY finally
  576. #else /* defined(__cplusplus_cli) */
  577. #define _M_CEE_FINALLY __finally
  578. #endif /* defined(__cplusplus_cli) */
  579. #define _BEGIN_LOCK(_Kind) \
  580. { \
  581. typedef int _TmpTestType; \
  582. __if_exists(_TmpTestType::ToString) \
  583. { \
  584. bool _MustReleaseLock = false; \
  585. int _LockKind = _Kind; \
  586. System::Runtime::CompilerServices::RuntimeHelpers::PrepareConstrainedRegions(); \
  587. try \
  588. } \
  589. { \
  590. __if_exists(_TmpTestType::ToString) \
  591. { \
  592. System::Runtime::CompilerServices::RuntimeHelpers::PrepareConstrainedRegions(); \
  593. try { } _M_CEE_FINALLY \
  594. { \
  595. _STD _Lockit::_Lockit_ctor(_LockKind); \
  596. _MustReleaseLock = true; \
  597. } \
  598. } \
  599. __if_not_exists(_TmpTestType::ToString) \
  600. { \
  601. _STD _Lockit _Lock(_Kind); \
  602. }
  603. #define _END_LOCK() \
  604. } \
  605. __if_exists(_TmpTestType::ToString) \
  606. { \
  607. _M_CEE_FINALLY \
  608. { \
  609. if (_MustReleaseLock) \
  610. { \
  611. _STD _Lockit::_Lockit_dtor(_LockKind); \
  612. } \
  613. } \
  614. } \
  615. }
  616. #define _BEGIN_LOCINFO(_VarName) \
  617. _BEGIN_LOCK(_LOCK_LOCALE) \
  618. _Locinfo _VarName;
  619. #define _END_LOCINFO() \
  620. _END_LOCK() \
  621. #define _RELIABILITY_CONTRACT \
  622. [System::Runtime::ConstrainedExecution::ReliabilityContract( \
  623. System::Runtime::ConstrainedExecution::Consistency::WillNotCorruptState, \
  624. System::Runtime::ConstrainedExecution::Cer::Success)]
  625. #else /* _M_CEE */
  626. #define _BEGIN_LOCK(_Kind) \
  627. { \
  628. _STD _Lockit _Lock(_Kind);
  629. #define _END_LOCK() \
  630. }
  631. #define _BEGIN_LOCINFO(_VarName) \
  632. { \
  633. _Locinfo _VarName;
  634. #define _END_LOCINFO() \
  635. }
  636. #define _RELIABILITY_CONTRACT
  637. #endif /* _M_CEE */
  638. class _CRTIMP2_PURE _Mutex
  639. { // lock under program control
  640. public:
  641. #if _MULTI_THREAD
  642. #if defined(_M_CEE_PURE) || defined(MRTDLL)
  643. __CLR_OR_THIS_CALL _Mutex(_Uninitialized)
  644. { // do nothing
  645. }
  646. __CLR_OR_THIS_CALL _Mutex()
  647. { // default construct
  648. _Mutex_ctor(this);
  649. }
  650. __CLR_OR_THIS_CALL ~_Mutex()
  651. { // destroy the object
  652. _Mutex_dtor(this);
  653. }
  654. void __CLR_OR_THIS_CALL _Lock()
  655. { // lock the mutex
  656. _Mutex_Lock(this);
  657. }
  658. void __CLR_OR_THIS_CALL _Unlock()
  659. { // unlock the mutex
  660. _Mutex_Unlock(this);
  661. }
  662. #else /* defined(_M_CEE_PURE) || defined(MRTDLL) */
  663. __thiscall _Mutex(_Uninitialized)
  664. { // do nothing
  665. }
  666. __thiscall _Mutex();
  667. __thiscall ~_Mutex();
  668. void __thiscall _Lock();
  669. void __thiscall _Unlock();
  670. #endif /* defined(_M_CEE_PURE) || defined(MRTDLL) */
  671. private:
  672. static _MRTIMP2_NPURE_NCEEPURE void __CLRCALL_PURE_OR_CDECL _Mutex_ctor(_Mutex *);
  673. static _MRTIMP2_NPURE_NCEEPURE void __CLRCALL_PURE_OR_CDECL _Mutex_dtor(_Mutex *);
  674. static _MRTIMP2_NPURE_NCEEPURE void __CLRCALL_PURE_OR_CDECL _Mutex_Lock(_Mutex *);
  675. static _MRTIMP2_NPURE_NCEEPURE void __CLRCALL_PURE_OR_CDECL _Mutex_Unlock(_Mutex *);
  676. __CLR_OR_THIS_CALL _Mutex(const _Mutex&); // not defined
  677. _Mutex& __CLR_OR_THIS_CALL operator=(const _Mutex&); // not defined
  678. void *_Mtx;
  679. #else /* _MULTI_THREAD */
  680. void _Lock()
  681. { // do nothing
  682. }
  683. void _Unlock()
  684. { // do nothing
  685. }
  686. #endif /* _MULTI_THREAD */
  687. };
  688. class _CRTIMP2_PURE _Init_locks
  689. { // initialize mutexes
  690. public:
  691. #if _MULTI_THREAD
  692. #if defined(_M_CEE_PURE) || defined(MRTDLL)
  693. __CLR_OR_THIS_CALL _Init_locks()
  694. { // default construct
  695. _Init_locks_ctor(this);
  696. }
  697. __CLR_OR_THIS_CALL ~_Init_locks()
  698. { // destroy the object
  699. _Init_locks_dtor(this);
  700. }
  701. #else /* defined(_M_CEE_PURE) || defined(MRTDLL) */
  702. __thiscall _Init_locks();
  703. __thiscall ~_Init_locks();
  704. #endif /* defined(_M_CEE_PURE) || defined(MRTDLL) */
  705. private:
  706. static _MRTIMP2_NPURE void __cdecl _Init_locks_ctor(_Init_locks *);
  707. static _MRTIMP2_NPURE void __cdecl _Init_locks_dtor(_Init_locks *);
  708. #else /* _MULTI_THREAD */
  709. _Init_locks()
  710. { // do nothing
  711. }
  712. ~_Init_locks()
  713. { // do nothing
  714. }
  715. #endif /* _MULTI_THREAD */
  716. };
  717. #pragma warning(pop)
  718. _STD_END
  719. #endif /* __cplusplus */
  720. #ifndef _RELIABILITY_CONTRACT
  721. #define _RELIABILITY_CONTRACT
  722. #endif /* _RELIABILITY_CONTRACT */
  723. /* MISCELLANEOUS MACROS AND TYPES */
  724. _C_STD_BEGIN
  725. _MRTIMP2 void __cdecl _Atexit(void (__cdecl *)(void));
  726. typedef int _Mbstatet;
  727. typedef unsigned long _Uint32t;
  728. #define _ATEXIT_T void
  729. #define _Mbstinit(x) mbstate_t x = {0}
  730. _C_STD_END
  731. #define _THROW_BAD_ALLOC _THROW1(...)
  732. #pragma pack(pop)
  733. #endif /* _YVALS */
  734. /*
  735. * Copyright (c) 1992-2009 by P.J. Plauger. ALL RIGHTS RESERVED.
  736. * Consult your license regarding permissions and restrictions.
  737. V5.20:0009 */