#pragma once
#ifndef _INC_WCHAR // include guard for 3rd party interop
#define _INC_WCHAR
#include <corecrt.h>
#include <corecrt_memcpy_s.h>
#include <corecrt_wconio.h>
#include <corecrt_wctype.h>
#include <corecrt_wdirect.h>
#include <corecrt_wio.h>
#include <corecrt_wprocess.h>
#include <corecrt_wstdio.h>
#include <corecrt_wstdlib.h>
#include <corecrt_wstring.h>
#include <corecrt_wtime.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <vcruntime_string.h>
_CRT_BEGIN_C_HEADER
__pragma
(pack(push,
8
))
extern
"C"
{
#define WCHAR_MIN 0x0000
#define WCHAR_MAX 0xffff
typedef
wchar_t
;
#if _CRT_FUNCTIONS_REQUIRED
_Check_return_opt_ _Success_(return != 0) _Ret_z_
_ACRTIMP wchar_t* __cdecl _wsetlocale(
__declspec
(dllimport)
wchar_t
*
__cdecl
(
_In_opt_z_ wchar_t const* _Locale
);
_Check_return_opt_
_ACRTIMP _locale_t __cdecl _wcreate_locale(
__declspec
(dllimport)
__cdecl
(
_In_z_ wchar_t const* _Locale
);
_ACRTIMP wint_t __cdecl btowc(
__declspec
(dllimport)
__cdecl
(
);
_ACRTIMP size_t __cdecl mbrlen(
__declspec
(dllimport)
__cdecl
(
_In_reads_bytes_opt_(_SizeInBytes) _Pre_opt_z_ char const* _Ch,
_In_ size_t _SizeInBytes,
_Inout_ mbstate_t* _State
);
_ACRTIMP size_t __cdecl mbrtowc(
__declspec
(dllimport)
__cdecl
(
_Pre_maybenull_ _Post_z_ wchar_t* _DstCh,
_In_reads_bytes_opt_(_SizeInBytes) _Pre_opt_z_ char const* _SrcCh,
_In_ size_t _SizeInBytes,
_Inout_ mbstate_t* _State
);
_Success_(return == 0)
_ACRTIMP errno_t __cdecl mbsrtowcs_s(
__declspec
(dllimport)
__cdecl
(
_Out_opt_ size_t* _Retval,
_Out_writes_opt_z_(_Size) wchar_t* _Dst,
_Deref_pre_opt_z_ char const** _PSrc,
_Inout_ mbstate_t* _State
);
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_3(
_Success_(return == 0)
errno_t, mbsrtowcs_s,
_Out_opt_ size_t*, _Retval,
_Post_z_ wchar_t, _Dest,
_Inout_ _Deref_prepost_opt_valid_ char const**, _PSource,
_In_ size_t, _Count,
_Inout_ mbstate_t*, _State
)
extern
"C++"
{
template
<
>
inline
__cdecl
(
*
,
wchar_t
(&
)[
],
char
const
**
,
,
*
)
throw
() {
return
(
,
,
,
,
,
); } }
__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_3_SIZE(
_Success_(return == 0) _ACRTIMP, mbsrtowcs,
_Out_writes_opt_z_(_Count), wchar_t, _Dest,
_Deref_pre_opt_z_ char const**, _PSrc,
_In_ size_t, _Count,
_Inout_ mbstate_t*, _State
)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"mbsrtowcs_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
__declspec
(dllimport)
__cdecl
(
wchar_t
*
,
char
const
**
,
,
*
);
_Success_(return == 0)
_ACRTIMP errno_t __cdecl wcrtomb_s(
__declspec
(dllimport)
__cdecl
(
_Out_opt_ size_t* _Retval,
_Out_writes_opt_z_(_SizeInBytes) char* _Dst,
_In_ size_t _SizeInBytes,
_Inout_opt_ mbstate_t* _State
);
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_2(
_Success_(return == 0)
errno_t, wcrtomb_s,
_Out_opt_ size_t*, _Retval,
_Out_writes_opt_z_(_Size) char, _Dest,
_In_ wchar_t, _Source,
_Inout_opt_ mbstate_t*, _State
)
extern
"C++"
{
template
<
>
inline
__cdecl
(
*
,
char
(&
)[
],
wchar_t
,
*
)
throw
() {
return
(
,
,
,
,
); } }
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_SIZE(
_ACRTIMP, wcrtomb,
_Pre_maybenull_ _Post_z_, char, _Dest,
_In_ wchar_t, _Source,
_Inout_opt_ mbstate_t*, _State
)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"wcrtomb_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
__declspec
(dllimport)
__cdecl
(
char
*
,
wchar_t
,
*
);
_Success_(return == 0)
_ACRTIMP errno_t __cdecl wcsrtombs_s(
__declspec
(dllimport)
__cdecl
(
_Out_opt_ size_t* _Retval,
_Out_writes_bytes_to_opt_(_SizeInBytes, *_Retval) char* _Dst,
_In_ size_t _SizeInBytes,
_Inout_ _Deref_prepost_z_ wchar_t const** _Src,
_Inout_opt_ mbstate_t* _State
);
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_3(
_Success_(return == 0)
errno_t, wcsrtombs_s,
_Out_opt_ size_t*, _Retval,
_Out_writes_opt_z_(_Size) char, _Dest,
_Inout_ _Deref_prepost_z_ wchar_t const**, _PSrc,
_In_ size_t, _Count,
_Inout_opt_ mbstate_t*, _State
)
extern
"C++"
{
template
<
>
inline
__cdecl
(
*
,
char
(&
)[
],
wchar_t
const
**
,
,
*
)
throw
() {
return
(
,
,
,
,
,
); } }
__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_3_SIZE(
_ACRTIMP, wcsrtombs,
_Pre_maybenull_ _Post_z_, char, _Dest,
_Inout_ _Deref_prepost_z_ wchar_t const**, _PSource,
_In_ size_t, _Count,
_Inout_opt_ mbstate_t*, _State
)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"wcsrtombs_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
__declspec
(dllimport)
__cdecl
(
char
*
,
wchar_t
const
**
,
,
*
);
_ACRTIMP int __cdecl wctob(
__declspec
(dllimport)
int
__cdecl
(
);
#if __STDC_WANT_SECURE_LIB__
_Success_(return == 0)
errno_t __CRTDECL wmemcpy_s(
_Out_writes_to_opt_(_N1, _N) wchar_t* _S1,
_In_reads_opt_(_N) wchar_t const* _S2,
);
_Success_(return == 0)
errno_t __CRTDECL wmemmove_s(
_Out_writes_to_opt_(_N1, _N) wchar_t* _S1,
_In_reads_opt_(_N) wchar_t const* _S2,
);
#endif // __STDC_WANT_SECURE_LIB__
__inline int __CRTDECL fwide(
)
{
return
(
);
}
__inline int __CRTDECL mbsinit(
_In_opt_ mbstate_t const* _P
)
{
return _P == NULL || _P->_Wchar == 0;
}
__inline wchar_t _CONST_RETURN* __CRTDECL wmemchr(
__inline
wchar_t
const
*
__cdecl
(
_In_reads_(_N) wchar_t const* _S,
)
{
for
(;
0
<
; ++
, --
)
if
(*
==
)
return (wchar_t _CONST_RETURN*)_S;
return
0
;
}
__inline int __CRTDECL wmemcmp(
_In_reads_(_N) wchar_t const* _S1,
_In_reads_(_N) wchar_t const* _S2,
)
{
for
(;
0
<
; ++
, ++
, --
)
if
(*
!= *
)
return
*
< *
? -
1
:
1
;
return
0
;
}
_Post_equal_to_(_S1)
_At_buffer_(_S1, _Iter_, _N, _Post_satisfies_(_S1[_Iter_] == _S2[_Iter_]))
__inline _CRT_INSECURE_DEPRECATE_MEMORY(wmemcpy_s)
wchar_t* __CRTDECL wmemcpy(
_Out_writes_all_(_N) wchar_t* _S1,
_In_reads_(_N) wchar_t const* _S2,
)
{
#pragma warning(push)
#pragma warning(push)
#pragma warning(disable : 4995 4996 6386)
#pragma warning(disable :
4995
4996
6386
)
return
(
wchar_t
*)
(
,
,
*
sizeof
(
wchar_t
));
#pragma warning(pop)
#pragma warning(pop)
}
__inline _CRT_INSECURE_DEPRECATE_MEMORY(wmemmove_s)
wchar_t* __CRTDECL wmemmove(
_Out_writes_all_opt_(_N) wchar_t* _S1,
_In_reads_opt_(_N) wchar_t const* _S2,
)
{
#pragma warning(push)
#pragma warning(push)
#pragma warning(disable : 4996 6386)
#pragma warning(disable :
4996
6386
)
return
(
wchar_t
*)
(
,
,
*
sizeof
(
wchar_t
));
#pragma warning(pop)
#pragma warning(pop)
}
_Post_equal_to_(_S)
_At_buffer_(_S, _Iter_, _N, _Post_satisfies_(_S[_Iter_] == _C))
__inline wchar_t* __CRTDECL wmemset(
__inline
wchar_t
*
__cdecl
(
_Out_writes_all_(_N) wchar_t* _S,
)
{
wchar_t
*
=
;
for
(;
0
<
; ++
_Su
, --
)
{
*
_Su
=
;
}
return
;
}
#ifdef __cplusplus
extern "C++" inline wchar_t* __CRTDECL wmemchr(
extern
"C++"
inline
wchar_t
*
__cdecl
(
_In_reads_(_N) wchar_t* _S,
)
{
wchar_t
const
*
const
=
;
return
const_cast
<
wchar_t
*>(
(
_SC
,
,
));
}
#endif // __cplusplus
#endif // _CRT_FUNCTIONS_REQUIRED
_CRT_END_C_HEADER
#endif // _INC_WCHAR