corecrt.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _INC_CORECRT
  7. #define _INC_CORECRT
  8. #include <_mingw.h>
  9. #ifndef __WIDL__
  10. #undef _CRT_PACKING
  11. #define _CRT_PACKING 8
  12. #pragma pack(push,_CRT_PACKING)
  13. #endif
  14. #ifdef __ERRCODE_DEFINED_MS
  15. /* #define __ERRCODE_DEFINED_MS */
  16. typedef int errcode;
  17. #endif
  18. #ifndef _CRTNOALIAS
  19. #define _CRTNOALIAS
  20. #endif
  21. #ifndef _CRTRESTRICT
  22. #define _CRTRESTRICT
  23. #endif
  24. #ifndef _SIZE_T_DEFINED
  25. #define _SIZE_T_DEFINED
  26. #undef size_t
  27. #ifdef _WIN64
  28. __MINGW_EXTENSION typedef unsigned __int64 size_t;
  29. #else
  30. typedef unsigned int size_t;
  31. #endif /* _WIN64 */
  32. #endif /* _SIZE_T_DEFINED */
  33. #ifndef _SSIZE_T_DEFINED
  34. #define _SSIZE_T_DEFINED
  35. #undef ssize_t
  36. #ifdef _WIN64
  37. __MINGW_EXTENSION typedef __int64 ssize_t;
  38. #else
  39. typedef int ssize_t;
  40. #endif /* _WIN64 */
  41. #endif /* _SSIZE_T_DEFINED */
  42. #ifndef _RSIZE_T_DEFINED
  43. typedef size_t rsize_t;
  44. #define _RSIZE_T_DEFINED
  45. #endif
  46. #ifndef _INTPTR_T_DEFINED
  47. #define _INTPTR_T_DEFINED
  48. #ifndef __intptr_t_defined
  49. #define __intptr_t_defined
  50. #undef intptr_t
  51. #ifdef _WIN64
  52. __MINGW_EXTENSION typedef __int64 intptr_t;
  53. #else
  54. typedef int intptr_t;
  55. #endif /* _WIN64 */
  56. #endif /* __intptr_t_defined */
  57. #endif /* _INTPTR_T_DEFINED */
  58. #ifndef _UINTPTR_T_DEFINED
  59. #define _UINTPTR_T_DEFINED
  60. #ifndef __uintptr_t_defined
  61. #define __uintptr_t_defined
  62. #undef uintptr_t
  63. #ifdef _WIN64
  64. __MINGW_EXTENSION typedef unsigned __int64 uintptr_t;
  65. #else
  66. typedef unsigned int uintptr_t;
  67. #endif /* _WIN64 */
  68. #endif /* __uintptr_t_defined */
  69. #endif /* _UINTPTR_T_DEFINED */
  70. #ifndef _PTRDIFF_T_DEFINED
  71. #define _PTRDIFF_T_DEFINED
  72. #ifndef _PTRDIFF_T_
  73. #define _PTRDIFF_T_
  74. #undef ptrdiff_t
  75. #ifdef _WIN64
  76. __MINGW_EXTENSION typedef __int64 ptrdiff_t;
  77. #else
  78. typedef int ptrdiff_t;
  79. #endif /* _WIN64 */
  80. #endif /* _PTRDIFF_T_ */
  81. #endif /* _PTRDIFF_T_DEFINED */
  82. #ifndef _WCHAR_T_DEFINED
  83. #define _WCHAR_T_DEFINED
  84. #if !defined(__cplusplus) && !defined(__WIDL__)
  85. typedef unsigned short wchar_t;
  86. #endif /* C++ */
  87. #endif /* _WCHAR_T_DEFINED */
  88. #ifndef _WCTYPE_T_DEFINED
  89. #define _WCTYPE_T_DEFINED
  90. #ifndef _WINT_T
  91. #define _WINT_T
  92. typedef unsigned short wint_t;
  93. typedef unsigned short wctype_t;
  94. #endif /* _WINT_T */
  95. #endif /* _WCTYPE_T_DEFINED */
  96. #ifndef _ERRCODE_DEFINED
  97. #define _ERRCODE_DEFINED
  98. typedef int errno_t;
  99. #endif
  100. #ifndef _TIME32_T_DEFINED
  101. #define _TIME32_T_DEFINED
  102. typedef long __time32_t;
  103. #endif
  104. #ifndef _TIME64_T_DEFINED
  105. #define _TIME64_T_DEFINED
  106. __MINGW_EXTENSION typedef __int64 __time64_t;
  107. #endif /* _TIME64_T_DEFINED */
  108. #ifdef _USE_32BIT_TIME_T
  109. #ifdef _WIN64
  110. #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
  111. #undef _USE_32BIT_TIME_T
  112. #endif
  113. #endif /* _USE_32BIT_TIME_T */
  114. #ifndef _TIME_T_DEFINED
  115. #define _TIME_T_DEFINED
  116. #ifdef _USE_32BIT_TIME_T
  117. typedef __time32_t time_t;
  118. #else
  119. typedef __time64_t time_t;
  120. #endif
  121. #endif /* _TIME_T_DEFINED */
  122. #ifndef _CRT_SECURE_CPP_NOTHROW
  123. #define _CRT_SECURE_CPP_NOTHROW throw()
  124. #endif
  125. #ifndef __CRTDECL
  126. #if !defined(__cplusplus) && defined(__GNUC__)
  127. #define __CRTDECL __cdecl __attribute__ ((__unused__))
  128. #else
  129. #define __CRTDECL __cdecl
  130. #endif
  131. #endif
  132. #if defined(__cplusplus) && _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES
  133. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(__ret,__func,__dsttype,__dst) \
  134. extern "C++" { \
  135. template <size_t __size> \
  136. inline __ret __cdecl __func(__dsttype (&__dst)[__size]) { \
  137. return __func(__dst,__size); \
  138. } \
  139. }
  140. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(__ret,__func,__dsttype,__dst,__type1,__arg1) \
  141. extern "C++" {\
  142. template <size_t __size> \
  143. inline __ret __cdecl __func(__dsttype (&__dst)[__size], __type1 __arg1) { \
  144. return __func(__dst,__size,__arg1); \
  145. }\
  146. }
  147. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2(__ret,__func,__dsttype,__dst,__type1,__arg1,__type2,__arg2)\
  148. extern "C++" {\
  149. template <size_t __size> inline\
  150. __ret __cdecl __func(__dsttype (&__dst)[__size], __type1 __arg1, __type2 __arg2) { \
  151. return __func(__dst,__size,__arg1,__arg2); \
  152. }\
  153. }
  154. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_3(__ret,__func,__dsttype,__dst,__type1,__arg1,__type2,__arg2,__type3,__arg3) \
  155. extern "C++" { \
  156. template <size_t __size> inline \
  157. __ret __cdecl __func(__dsttype (&__dst)[__size], __type1 __arg1, __type2 __arg2, __type3 __arg3) { \
  158. return __func(__dst,__size,__arg1,__arg2,__arg3); \
  159. }\
  160. }
  161. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4(__ret,__func,__dsttype,__dst,__type1,__arg1,__type2,__arg2,__type3,__arg3,__type4,__arg4) \
  162. extern "C++" { \
  163. template <size_t __size> inline \
  164. __ret __cdecl __func(__dsttype (&__dst)[__size], __type1 __arg1, __type2 __arg2, __type3 __arg3, __type4 __arg4) { \
  165. return __func(__dst,__size,__arg1,__arg2,__arg3,__arg4); \
  166. }\
  167. }
  168. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(__ret,__func,__type0,__arg0,__dsttype,__dst,__type1,__arg1) \
  169. extern "C++" { \
  170. template <size_t __size> inline \
  171. __ret __cdecl __func(__type0 __arg0, __dsttype (&__dst)[__size], __type1 __arg1) { \
  172. return __func(__arg0, __dst, __size, __arg1); \
  173. } \
  174. }
  175. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_2(__ret,__func,__type0,__arg0,__dsttype,__dst,__type1,__arg1,__type2,__arg2) \
  176. extern "C++" { \
  177. template <size_t __size> inline \
  178. __ret __cdecl __func(__type0 __arg0, __dsttype (&__dst)[__size], __type1 __arg1, __type2 __arg2) { \
  179. return __func(__arg0, __dst, __size, __arg1, __arg2); \
  180. } \
  181. }
  182. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_3(__ret,__func,__type0,__arg0,__dsttype,__dst,__type1,__arg1,__type2,__arg2,__type3,__arg3) \
  183. extern "C++" { \
  184. template <size_t __size> inline \
  185. __ret __cdecl __func(__type0 __arg0, __dsttype (&__dst)[__size], __type1 __arg1, __type2 __arg2, __type3 __arg3) { \
  186. return __func(__arg0, __dst, __size, __arg1, __arg2, __arg3); \
  187. } \
  188. }
  189. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_2_0(__ret,__func,__type1,__arg1,__type2,__arg2,__dsttype,__dst) \
  190. extern "C++" { \
  191. template <size_t __size> inline \
  192. __ret __cdecl __func(__type1 __arg1, __type2 __arg2, __dsttype (&__dst)[__size]) { \
  193. return __func(__arg1, __arg2, __dst, __size); \
  194. } \
  195. }
  196. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1_ARGLIST(__ret,__func,__vfunc,__dsttype,__dst,__type1,__arg1) \
  197. extern "C++" {\
  198. template <size_t __size> \
  199. inline __ret __cdecl __func(__dsttype (&__dst)[__size], __type1 __arg1, ...) { \
  200. va_list __vaargs; \
  201. _crt_va_start(__vaargs, __arg1); \
  202. __ret __retval = __vfunc(__dst,__size,__arg1,__vaargs); \
  203. _crt_va_end(__vaargs); \
  204. return __retval; \
  205. }\
  206. }
  207. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2_ARGLIST(__ret,__func,__vfunc,__dsttype,__dst,__type1,__arg1,__type2,__arg2) \
  208. extern "C++" {\
  209. template <size_t __size> \
  210. inline __ret __cdecl __func(__dsttype (&__dst)[__size], __type1 __arg1, __type2 __arg2, ...) { \
  211. va_list __vaargs; \
  212. _crt_va_start(__vaargs, __arg2); \
  213. __ret __retval = __vfunc(__dst,__size,__arg1,__arg2,__vaargs); \
  214. _crt_va_end(__vaargs); \
  215. return __retval; \
  216. }\
  217. }
  218. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_SPLITPATH(__ret,__func,__dsttype,__src) \
  219. extern "C++" { \
  220. template <size_t __drive_size, size_t __dir_size, size_t __name_size, size_t __ext_size> inline \
  221. __ret __cdecl __func(const __dsttype *__src, __dsttype (&__drive)[__drive_size], __dsttype (&__dir)[__dir_size], __dsttype (&__name)[__name_size], __dsttype (&__ext)[__ext_size]) { \
  222. return __func(__src, __drive, __drive_size, __dir, __dir_size, __name, __name_size, __ext, __ext_size); \
  223. } \
  224. }
  225. #else
  226. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(__ret,__func,__dsttype,__dst)
  227. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(__ret,__func,__dsttype,__dst,__type1,__arg1)
  228. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2(__ret,__func,__dsttype,__dst,__type1,__arg1,__type2,__arg2)
  229. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_3(__ret,__func,__dsttype,__dst,__type1,__arg1,__type2,__arg2,__type3,__arg3)
  230. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4(__ret,__func,__dsttype,__dst,__type1,__arg1,__type2,__arg2,__type3,__arg3,__type4,__arg4)
  231. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(__ret,__func,__type0,__arg0,__dsttype,__dst,__type1,__arg1)
  232. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_2(__ret,__func,__type0,__arg0,__dsttype,__dst,__type1,__arg1,__type2,__arg2)
  233. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_3(__ret,__func,__type0,__arg0,__dsttype,__dst,__type1,__arg1,__type2,__arg2,__type3,__arg3)
  234. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_2_0(__ret,__func,__type1,__arg1,__type2,__arg2,__dsttype,__dst)
  235. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1_ARGLIST(__ret,__func,__vfunc,__dsttype,__dst,__type1,__arg1)
  236. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2_ARGLIST(__ret,__func,__vfunc,__dsttype,__dst,__type1,__arg1,__type2,__arg2)
  237. #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_SPLITPATH(__ret,__func,__dsttype,__src)
  238. #endif
  239. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(__ret_type, __ret_policy, __decl_spec, __name, __dst_attr, __dst_type, __dst) \
  240. __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0_EX(__ret_type, __ret_policy, __decl_spec, __func_name, __func_name##_s, __dst_attr, __dst_type, __dst)
  241. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1(__ret_type, __ret_policy, __decl_spec, __name, __dst_attr, __dst_type, __dst, __arg1_type, __arg1) \
  242. __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_EX(__ret_type, __ret_policy, __decl_spec, __func_name, __func_name##_s, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2)
  243. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2(__ret_type, __ret_policy, __decl_spec, __name, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2) \
  244. __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_EX(__ret_type, __ret_policy, __decl_spec, __func_name, __func_name##_s, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2)
  245. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_3(__ret_type, __ret_policy, __decl_spec, __name, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2, __arg3_type, __arg3) \
  246. __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_3_EX(__ret_type, __ret_policy, __decl_spec, __func_name, __func_name##_s, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2, __arg3_type, __arg3)
  247. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_4(__ret_type, __ret_policy, __decl_spec, __name, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2, __arg3_type, __arg3, __arg4_type, __arg4) \
  248. __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_4_EX(__ret_type, __ret_policy, __decl_spec, __func_name, __func_name##_s, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2, __arg3_type, __arg3, __arg4_type, __arg4)
  249. #if defined(__cplusplus) && _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
  250. #define __RETURN_POLICY_SAME(__func_call, __dst) return (__func_call)
  251. #define __RETURN_POLICY_DST(__func_call, __dst) return ((__func_call) == 0 ? __dst : 0)
  252. #define __RETURN_POLICY_VOID(__func_call, __dst) (__func_call); return
  253. #define __EMPTY_DECLSPEC
  254. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __dst_attr, __dst_type, __dst) \
  255. __inline __ret_type __CRTDECL __insecure_##__name(__dst_attr __dst_type *__dst) \
  256. { \
  257. __decl_spec __ret_type __cdecl __name(__dst_type *__dst); \
  258. return __name(__dst); \
  259. } \
  260. extern "C++" { \
  261. template <typename _T> \
  262. inline __ret_type __CRTDECL __name(_T &__dst) _CRT_SECURE_CPP_NOTHROW { \
  263. return __insecure_##__name(static_cast<__dst_type*>(__dst)); \
  264. } \
  265. template <typename _T> \
  266. inline __ret_type __CRTDECL __name(const _T &__dst) _CRT_SECURE_CPP_NOTHROW { \
  267. return __insecure_##__name(static_cast<__dst_type *>(__dst)); \
  268. } \
  269. template <> \
  270. inline __ret_type __CRTDECL __name(__dst_type *&__dst) _CRT_SECURE_CPP_NOTHROW { \
  271. return __insecure_##__name(__dst); \
  272. } \
  273. template <size_t __size> \
  274. inline __ret_type __CRTDECL __name(__dst_type (&__dst)[__size]) _CRT_SECURE_CPP_NOTHROW { \
  275. __ret_policy(__sec_name(__dst, __size), __dst); \
  276. } \
  277. }
  278. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __sec_dst_type, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2) \
  279. __inline __ret_type __CRTDECL __insecure_##__name(__dst_attr __dst_type *__dst, __arg1_type __arg1, __arg2_type __arg2) \
  280. { \
  281. __decl_spec __ret_type __cdecl __name(__dst_type *__dst, __arg1_type, __arg2_type); \
  282. return __name(__dst, __arg1, __arg2); \
  283. } \
  284. extern "C++" { \
  285. template <typename _T> \
  286. inline __ret_type __CRTDECL __name(_T &__dst, __arg1_type __arg1, __arg2_type __arg2) _CRT_SECURE_CPP_NOTHROW { \
  287. return __insecure_##__name(static_cast<__dst_type*>(__dst), __arg1, __arg2); \
  288. } \
  289. template <typename _T> \
  290. inline __ret_type __CRTDECL __name(const _T &__dst, __arg1_type __arg1, __arg2_type __arg2) _CRT_SECURE_CPP_NOTHROW { \
  291. return __insecure_##__name(static_cast<__dst_type *>(__dst), __arg1, __arg2); \
  292. } \
  293. template <> \
  294. inline __ret_type __CRTDECL __name(__dst_type *&__dst, __arg1_type __arg1, __arg2_type __arg2) _CRT_SECURE_CPP_NOTHROW { \
  295. return __insecure_##__name(__dst, __arg1, __arg2); \
  296. } \
  297. template <size_t __size> \
  298. inline __ret_type __CRTDECL __name(__sec_dst_type (&__dst)[__size], __arg1_type __arg1, __arg2_type __arg2) _CRT_SECURE_CPP_NOTHROW { \
  299. __ret_policy(__sec_name(__dst, __size), __dst); \
  300. } \
  301. }
  302. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __sec_dst_type, __dst_attr, __dst_type, __dst, __arg1_type, __arg1) \
  303. __inline __ret_type __CRTDECL __insecure_##__name(__dst_attr __dst_type *__dst, __arg1_type __arg1) \
  304. { \
  305. __decl_spec __ret_type __cdecl __name(__dst_type *__dst, __arg1_type); \
  306. return __name(__dst, __arg1); \
  307. } \
  308. extern "C++" { \
  309. template <typename _T> \
  310. inline __ret_type __CRTDECL __name(_T &__dst, __arg1_type __arg1) _CRT_SECURE_CPP_NOTHROW { \
  311. return __insecure_##__name(static_cast<__dst_type*>(__dst), __arg1); \
  312. } \
  313. template <typename _T> \
  314. inline __ret_type __CRTDECL __name(const _T &__dst, __arg1_type __arg1) _CRT_SECURE_CPP_NOTHROW { \
  315. return __insecure_##__name(static_cast<__dst_type *>(__dst), __arg1); \
  316. } \
  317. template <> \
  318. inline __ret_type __CRTDECL __name(__dst_type *&__dst, __arg1_type __arg1) _CRT_SECURE_CPP_NOTHROW { \
  319. return __insecure_##__name(__dst, __arg1); \
  320. } \
  321. template <size_t __size> \
  322. inline __ret_type __CRTDECL __name(__sec_dst_type (&__dst)[__size], __arg1_type __arg1) _CRT_SECURE_CPP_NOTHROW { \
  323. __ret_policy(__sec_name(__dst, __size), __dst); \
  324. } \
  325. }
  326. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_3_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __sec_dst_type, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2, __arg3_type, __arg3) \
  327. __inline __ret_type __CRTDECL __insecure_##__name(__dst_attr __dst_type *__dst, __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3) \
  328. { \
  329. __decl_spec __ret_type __cdecl __name(__dst_type *__dst, __arg1_type, __arg2_type, __arg3_type); \
  330. return __name(__dst, __arg1, __arg2, __arg3); \
  331. } \
  332. extern "C++" { \
  333. template <typename _T> \
  334. inline __ret_type __CRTDECL __name(_T &__dst, __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3) _CRT_SECURE_CPP_NOTHROW { \
  335. return __insecure_##__name(static_cast<__dst_type*>(__dst), __arg1, __arg2, __arg3); \
  336. } \
  337. template <typename _T> \
  338. inline __ret_type __CRTDECL __name(const _T &__dst, __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3) _CRT_SECURE_CPP_NOTHROW { \
  339. return __insecure_##__name(static_cast<__dst_type *>(__dst), __arg1, __arg2, __arg3); \
  340. } \
  341. template <> \
  342. inline __ret_type __CRTDECL __name(__dst_type *&__dst, __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3) _CRT_SECURE_CPP_NOTHROW { \
  343. return __insecure_##__name(__dst, __arg1, __arg2, __arg3); \
  344. } \
  345. template <size_t __size> \
  346. inline __ret_type __CRTDECL __name(__sec_dst_type (&__dst)[__size], __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3) _CRT_SECURE_CPP_NOTHROW { \
  347. __ret_policy(__sec_name(__dst, __size), __dst); \
  348. } \
  349. }
  350. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_4_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __sec_dst_type, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2, __arg3_type, __arg3, __arg4_type, __arg4) \
  351. __inline __ret_type __CRTDECL __insecure_##__name(__dst_attr __dst_type *__dst, __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3, __arg4_type __arg4) \
  352. { \
  353. __decl_spec __ret_type __cdecl __name(__dst_type *__dst, __arg1_type, __arg2_type, __arg3_type, __arg4_type); \
  354. return __name(__dst, __arg1, __arg2, __arg3, __arg4); \
  355. } \
  356. extern "C++" { \
  357. template <typename _T> \
  358. inline __ret_type __CRTDECL __name(_T &__dst, __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3, __arg4_type __arg4) _CRT_SECURE_CPP_NOTHROW { \
  359. return __insecure_##__name(static_cast<__dst_type*>(__dst), __arg1, __arg2, __arg3, __arg4); \
  360. } \
  361. template <typename _T> \
  362. inline __ret_type __CRTDECL __name(const _T &__dst, __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3, __arg4_type __arg4) _CRT_SECURE_CPP_NOTHROW { \
  363. return __insecure_##__name(static_cast<__dst_type *>(__dst), __arg1, __arg2, __arg3, __arg4); \
  364. } \
  365. template <> \
  366. inline __ret_type __CRTDECL __name(__dst_type *&__dst, __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3, __arg4_type __arg4) _CRT_SECURE_CPP_NOTHROW { \
  367. return __insecure_##__name(__dst, __arg1, __arg2, __arg3, __arg4); \
  368. } \
  369. template <size_t __size> \
  370. inline __ret_type __CRTDECL __name(__sec_dst_type (&__dst)[__size], __arg1_type __arg1, __arg2_type __arg2, __arg3_type __arg3, __arg4_type __arg4) _CRT_SECURE_CPP_NOTHROW { \
  371. __ret_policy(__sec_name(__dst, __size)); \
  372. } \
  373. }
  374. #else
  375. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __dst_attr, __dst_type, __dst)
  376. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __dst_attr, __dst_type, __dst, __arg1_type, __arg1)
  377. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2)
  378. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_3_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2, __arg3_type, __arg3)
  379. #define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_4_EX(__ret_type, __ret_policy, __decl_spec, __name, __sec_name, __dst_attr, __dst_type, __dst, __arg1_type, __arg1, __arg2_type, __arg2, __arg3_type, __arg3, __arg4_type, __arg4)
  380. #endif
  381. struct threadlocaleinfostruct;
  382. struct threadmbcinfostruct;
  383. typedef struct threadlocaleinfostruct *pthreadlocinfo;
  384. typedef struct threadmbcinfostruct *pthreadmbcinfo;
  385. struct __lc_time_data;
  386. typedef struct localeinfo_struct {
  387. pthreadlocinfo locinfo;
  388. pthreadmbcinfo mbcinfo;
  389. } _locale_tstruct,*_locale_t;
  390. #ifndef _TAGLC_ID_DEFINED
  391. #define _TAGLC_ID_DEFINED
  392. typedef struct tagLC_ID {
  393. unsigned short wLanguage;
  394. unsigned short wCountry;
  395. unsigned short wCodePage;
  396. } LC_ID,*LPLC_ID;
  397. #endif /* _TAGLC_ID_DEFINED */
  398. #ifndef _THREADLOCALEINFO
  399. #define _THREADLOCALEINFO
  400. typedef struct threadlocaleinfostruct {
  401. #ifdef _UCRT
  402. const unsigned short *_locale_pctype;
  403. int _locale_mb_cur_max;
  404. unsigned int _locale_lc_codepage;
  405. #else
  406. int refcount;
  407. unsigned int lc_codepage;
  408. unsigned int lc_collate_cp;
  409. unsigned long lc_handle[6];
  410. LC_ID lc_id[6];
  411. struct {
  412. char *locale;
  413. wchar_t *wlocale;
  414. int *refcount;
  415. int *wrefcount;
  416. } lc_category[6];
  417. int lc_clike;
  418. int mb_cur_max;
  419. int *lconv_intl_refcount;
  420. int *lconv_num_refcount;
  421. int *lconv_mon_refcount;
  422. struct lconv *lconv;
  423. int *ctype1_refcount;
  424. unsigned short *ctype1;
  425. const unsigned short *pctype;
  426. const unsigned char *pclmap;
  427. const unsigned char *pcumap;
  428. struct __lc_time_data *lc_time_curr;
  429. #endif
  430. } threadlocinfo;
  431. #endif /* _THREADLOCALEINFO */
  432. #ifndef __crt_typefix
  433. #define __crt_typefix(ctype)
  434. #endif
  435. #ifndef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
  436. #ifdef WINAPI_FAMILY
  437. #include <winapifamily.h>
  438. #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
  439. #define _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
  440. #endif
  441. #else /* !WINAPI_FAMILY */
  442. #define _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
  443. #endif /* !WINAPI_FAMILY */
  444. #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
  445. #ifndef __WIDL__
  446. #pragma pack(pop)
  447. #endif
  448. #endif /* _INC_CORECRT */