18#pragma pack(push, _CRT_PACKING)
20#if defined(__GNUC__) || defined(__clang__)
35 _Out_ int* _UnlockFlag,
45 _Out_ int* _UnlockFlag,
69template <
typename Character>
72#define _CORECRT_APPLY_TO_MAPPINGS(_APPLY) \
73 _APPLY(capture_argv, __acrt_capture_narrow_argv, __acrt_capture_wide_argv ) \
74 _APPLY(create_process, __acrt_CreateProcessA, CreateProcessW ) \
75 _APPLY(find_first_file_ex, __acrt_FindFirstFileExA, FindFirstFileExW ) \
76 _APPLY(find_next_file, __acrt_FindNextFileA, FindNextFileW ) \
77 _APPLY(free_environment_strings, FreeEnvironmentStringsA, FreeEnvironmentStringsW ) \
78 _APPLY(ftprintf, fprintf, fwprintf ) \
79 _APPLY(get_current_directory, __acrt_get_current_directory_narrow_acp_or_utf8, __acrt_get_current_directory_wide ) \
80 _APPLY(get_environment_from_os, __dcrt_get_narrow_environment_from_os, __dcrt_get_wide_environment_from_os ) \
81 _APPLY(get_full_path_name, __acrt_get_full_path_name_narrow_acp_or_utf8, __acrt_get_full_path_name_wide ) \
82 _APPLY(get_module_file_name, __acrt_GetModuleFileNameA, GetModuleFileNameW ) \
83 _APPLY(get_or_create_environment_nolock, __dcrt_get_or_create_narrow_environment_nolock, __dcrt_get_or_create_wide_environment_nolock ) \
84 _APPLY(get_temp_path, __acrt_GetTempPath2A, __acrt_GetTempPath2W ) \
85 _APPLY(getc_nolock, _getc_nolock, _getwc_nolock ) \
86 _APPLY(gettche_nolock, _getche_nolock, _getwche_nolock ) \
87 _APPLY(initialize_environment_nolock, _initialize_narrow_environment, _initialize_wide_environment ) \
88 _APPLY(istspace, isspace, iswspace ) \
89 _APPLY(itot_s, _itoa_s, _itow_s ) \
90 _APPLY(message_box, __acrt_MessageBoxA, __acrt_MessageBoxW ) \
91 _APPLY(open_file, _openfile, _wopenfile ) \
92 _APPLY(output_debug_string, __acrt_OutputDebugStringA, OutputDebugStringW ) \
93 _APPLY(pack_command_line_and_environment, __acrt_pack_narrow_command_line_and_environment, __acrt_pack_wide_command_line_and_environment ) \
94 _APPLY(puttc_nolock_internal, _fputc_nolock_internal, _fputwc_nolock_internal ) \
95 _APPLY(puttch_nolock_internal, _putch_nolock_internal, _putwch_nolock_internal ) \
96 _APPLY(set_current_directory, __acrt_SetCurrentDirectoryA, SetCurrentDirectoryW ) \
97 _APPLY(set_environment_variable, __acrt_SetEnvironmentVariableA, SetEnvironmentVariableW ) \
98 _APPLY(set_program_name, _set_pgmptr, _set_wpgmptr ) \
99 _APPLY(set_variable_in_environment_nolock, __dcrt_set_variable_in_narrow_environment_nolock, __dcrt_set_variable_in_wide_environment_nolock) \
100 _APPLY(show_message_box, __acrt_show_narrow_message_box, __acrt_show_wide_message_box ) \
101 _APPLY(sntprintf_s, _snprintf_s, _snwprintf_s ) \
102 _APPLY(taccess_s, _access_s, _waccess_s ) \
103 _APPLY(tasctime, asctime, _wasctime ) \
104 _APPLY(tasctime_s, asctime_s, _wasctime_s ) \
105 _APPLY(tcscat_s, strcat_s, wcscat_s ) \
106 _APPLY(tcschr, strchr, wcschr ) \
107 _APPLY(tcscmp, strcmp, wcscmp ) \
108 _APPLY(tcscpy_s, strcpy_s, wcscpy_s ) \
109 _APPLY(tcserror_s, strerror_s, _wcserror_s ) \
110 _APPLY(tcsicmp, _stricmp, _wcsicmp ) \
111 _APPLY(tcslen, strlen, wcslen ) \
112 _APPLY(tcsnlen_s, strnlen_s, wcsnlen_s ) \
113 _APPLY(tcsncat_s, strncat_s, wcsncat_s ) \
114 _APPLY(tcsncmp, strncmp, wcsncmp ) \
115 _APPLY(tcsncpy_s, strncpy_s, wcsncpy_s ) \
116 _APPLY(tcsnicmp, _strnicmp, _wcsnicmp ) \
117 _APPLY(tcsnicoll, _strnicoll, _wcsnicoll ) \
118 _APPLY(tcsnlen, strnlen, wcsnlen ) \
119 _APPLY(tcspbrk, strpbrk, wcspbrk ) \
120 _APPLY(tcsrchr, strrchr, wcsrchr ) \
121 _APPLY(tcstoull, strtoull, wcstoull ) \
122 _APPLY(tdupenv_s_crt, _dupenv_s, _wdupenv_s ) \
123 _APPLY(texecve, _execve, _wexecve ) \
124 _APPLY(tfdopen, _fdopen, _wfdopen ) \
125 _APPLY(tfullpath, _fullpath, _wfullpath ) \
126 _APPLY(tgetcwd, _getcwd, _wgetcwd ) \
127 _APPLY(tgetpath, __acrt_getpath, __acrt_wgetpath ) \
128 _APPLY(tmktemp_s, _mktemp_s, _wmktemp_s ) \
129 _APPLY(tsopen_nolock, _sopen_nolock, _wsopen_nolock ) \
130 _APPLY(tsopen_s, _sopen_s, _wsopen_s ) \
131 _APPLY(tspawnve, _spawnve, _wspawnve ) \
132 _APPLY(tspawnvpe, _spawnvpe, _wspawnvpe ) \
133 _APPLY(ulltot_s, _ui64toa_s, _ui64tow_s ) \
134 _APPLY(ultot_s, _ultoa_s, _ultow_s ) \
135 _APPLY(ungettc_nolock, _ungetc_nolock, _ungetwc_nolock ) \
136 _APPLY(ungettch_nolock, _ungetch_nolock, _ungetwch_nolock )
148 #define _APPLY(name, narrow_name, wide_name) _CORECRT_GENERATE_FORWARDER(static, __cdecl, name, narrow_name)
163 #define _APPLY(name, narrow_name, wide_name) _CORECRT_GENERATE_FORWARDER(static, __cdecl, name, wide_name)
168#undef _CORECRT_APPLY_TO_MAPPINGS
172#define _GENERATE_TCHAR_STRING_FUNCTIONS(name, string) \
173 static char const* __cdecl _CRT_CONCATENATE(get_, name)(char) throw() { return string; } \
174 static wchar_t const* __cdecl _CRT_CONCATENATE(get_, name)(wchar_t) throw() { return _CRT_WIDE(string); } \
175 static size_t const _CRT_CONCATENATE(name, _length) = _countof(string) - 1; \
176 static size_t const _CRT_CONCATENATE(name, _count ) = _countof(string);
185template <
typename Integer>
188#define _CORECRT_APPLY_TO_MAPPINGS(_APPLY) \
189 _APPLY(ftell_nolock, _ftell_nolock, _ftelli64_nolock) \
190 _APPLY(lseek, _lseek, _lseeki64 ) \
191 _APPLY(lseek_nolock, _lseek_nolock, _lseeki64_nolock) \
192 _APPLY(futime, _futime32, _futime64 ) \
193 _APPLY(gmtime_s, _gmtime32_s, _gmtime64_s ) \
194 _APPLY(localtime_s, _localtime32_s, _localtime64_s ) \
195 _APPLY(loctotime, __loctotime32_t, __loctotime64_t ) \
196 _APPLY(time, _time32, _time64 )
201 #define _APPLY(name, name_32, name_64) _CORECRT_GENERATE_FORWARDER(static, __cdecl, name, name_32)
209 #define _APPLY(name, name_32, name_64) _CORECRT_GENERATE_FORWARDER(static, __cdecl, name, name_64)
214#undef _CORECRT_APPLY_TO_MAPPINGS
280 _In_z_ char const*
const string
283 return static_cast<size_t>(__acrt_MultiByteToWideChar(
code_page, 0,
string, -1,
nullptr, 0));
288 _In_z_ wchar_t const*
const string
295inline size_t __crt_transform_string(
307inline size_t __crt_transform_string(
309 _In_z_ wchar_t const*
const string,
return __acrt_WideCharToMultiByte(code_page, 0, buffer.get(), -1, result_size !=0 ? result :nullptr, result_size, nullptr, nullptr)
_Out_opt_ UINT * code_page
_Out_ int _In_z_ char const _In_ int _In_ int _In_ int _PermissionFlag
_Out_ int _In_z_ char const _In_ int _In_ int _In_ int _In_ int _SecureFlag
_Check_return_opt_ long __cdecl _lseek_nolock(_In_ int _FileHandle, _In_ long _Offset, _In_ int _Origin)
_Check_return_opt_ __int64 __cdecl _lseeki64_nolock(_In_ int _FileHandle, _In_ __int64 _Offset, _In_ int _Origin)
__time32_t __cdecl __loctotime32_t(int, int, int, int, int, int, int)
__time64_t __cdecl __loctotime64_t(int, int, int, int, int, int, int)
#define _CORECRT_APPLY_TO_MAPPINGS(_APPLY)
_In_z_ char const *const size_t const buffer_count
size_t __crt_compute_required_transform_buffer_count(unsigned const code_page, _In_z_ char const *const string)
#define _APPLY(name, narrow_name, wide_name)
_Check_return_wat_ _ACRTIMP errno_t __cdecl _waccess_s(_In_z_ wchar_t const *_FileName, _In_ int _AccessMode)
_Check_return_ _In_ int _OpenFlag
_Check_return_ _In_ int _Check_return_ _In_ int _In_ int _ShareFlag
_Check_return_ _Ret_maybenull_ _In_ size_t _In_ size_t _Offset
#define _Out_writes_z_(s)
errno_t __cdecl _wsopen_nolock(int *const punlock_flag, int *const pfh, wchar_t const *const path, int const oflag, int const shflag, int const pmode, int const secure)
errno_t __cdecl _sopen_nolock(int *const punlock_flag, int *const pfh, char const *const path, int const oflag, int const shflag, int const pmode, int const secure)
_In_ size_t _In_ const __time32_t * _Time
_CRTIMP __time32_t __cdecl _time32(_Out_opt_ __time32_t *_Time)
_ACRTIMP __time64_t __cdecl _time64(_Out_opt_ __time64_t *_Time)
int CDECL _access_s(const char *filename, int mode)
WIN32_FIND_DATAA win32_find_data_type
STARTUPINFOA startup_info_type
unsigned char unsigned_char_type
WIN32_FIND_DATAW win32_find_data_type
STARTUPINFOW startup_info_type
wchar_t unsigned_char_type
#define _Check_return_opt_