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