Kai Tietz | 9d937a7 | 2007-08-10 10:41:48 +0000 | [diff] [blame] | 1 | /** |
| 2 | * This file has no copyright assigned and is placed in the Public Domain. |
Rafaël Carré | 8a67ab4 | 2012-06-28 15:40:59 +0000 | [diff] [blame] | 3 | * This file is part of the mingw-w64 runtime package. |
Kai Tietz | d42ac88 | 2010-01-15 20:17:42 +0000 | [diff] [blame] | 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
Kai Tietz | 9d937a7 | 2007-08-10 10:41:48 +0000 | [diff] [blame] | 5 | */ |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 6 | #ifndef _INC_WCHAR |
| 7 | #define _INC_WCHAR |
| 8 | |
Jacek Caban | 228a789 | 2019-02-28 18:22:42 +0100 | [diff] [blame] | 9 | #include <corecrt.h> |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 10 | #include <corecrt_stdio_config.h> |
Jacek Caban | 228a789 | 2019-02-28 18:22:42 +0100 | [diff] [blame] | 11 | #include <corecrt_wstdlib.h> |
LIU Hao | 60306a9 | 2025-02-25 00:13:30 +0800 | [diff] [blame] | 12 | #include <corecrt_wctype.h> |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 13 | |
Martin Storsjö | eb46f44 | 2020-04-30 14:02:04 +0300 | [diff] [blame] | 14 | #if __USE_MINGW_ANSI_STDIO && !defined (__USE_MINGW_STRTOX) && !defined(_CRTBLD) |
Jonathan Yong | e09effa | 2013-01-11 16:20:29 +0000 | [diff] [blame] | 15 | #define __USE_MINGW_STRTOX 1 |
| 16 | #endif |
| 17 | |
David Wohlferd | 6172d2f | 2016-08-26 17:31:14 -0700 | [diff] [blame] | 18 | #if defined(__LIBMSVCRT__) |
| 19 | /* When building mingw-w64, this should be blank. */ |
| 20 | #define _SECIMP |
| 21 | #else |
| 22 | #ifndef _SECIMP |
| 23 | #define _SECIMP __declspec(dllimport) |
| 24 | #endif /* _SECIMP */ |
Pali Rohár | 03e1647 | 2022-09-18 00:53:32 +0200 | [diff] [blame] | 25 | #endif /* defined(__LIBMSVCRT__) */ |
David Wohlferd | 6172d2f | 2016-08-26 17:31:14 -0700 | [diff] [blame] | 26 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 27 | #pragma pack(push,_CRT_PACKING) |
| 28 | |
| 29 | #ifdef __cplusplus |
| 30 | extern "C" { |
| 31 | #endif |
| 32 | |
Kai Tietz | 4e617c8 | 2009-02-13 14:41:02 +0000 | [diff] [blame] | 33 | #ifndef WCHAR_MIN /* also in stdint.h */ |
Kai Tietz | 81889c8 | 2009-07-31 10:03:25 +0000 | [diff] [blame] | 34 | #define WCHAR_MIN 0U |
| 35 | #define WCHAR_MAX 0xffffU |
Kai Tietz | 4e617c8 | 2009-02-13 14:41:02 +0000 | [diff] [blame] | 36 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 37 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 38 | #ifndef WEOF |
| 39 | #define WEOF (wint_t)(0xFFFF) |
| 40 | #endif |
| 41 | |
| 42 | #ifndef _FILE_DEFINED |
| 43 | struct _iobuf { |
| 44 | char *_ptr; |
| 45 | int _cnt; |
| 46 | char *_base; |
| 47 | int _flag; |
| 48 | int _file; |
| 49 | int _charbuf; |
| 50 | int _bufsiz; |
| 51 | char *_tmpfname; |
| 52 | }; |
| 53 | typedef struct _iobuf FILE; |
| 54 | #define _FILE_DEFINED |
| 55 | #endif |
| 56 | |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 57 | _CRTIMP FILE *__cdecl __acrt_iob_func(unsigned index); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 58 | #ifndef _STDIO_DEFINED |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 59 | _CRTIMP FILE *__cdecl __iob_func(void); |
Kai Tietz | 433e75f | 2007-11-15 11:24:17 +0000 | [diff] [blame] | 60 | #define _iob __iob_func() |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 61 | #endif |
| 62 | |
| 63 | #ifndef _STDSTREAM_DEFINED |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 64 | #define stdin (__acrt_iob_func(0)) |
| 65 | #define stdout (__acrt_iob_func(1)) |
| 66 | #define stderr (__acrt_iob_func(2)) |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 67 | #define _STDSTREAM_DEFINED |
| 68 | #endif |
| 69 | |
| 70 | #ifndef _FSIZE_T_DEFINED |
| 71 | typedef unsigned long _fsize_t; |
| 72 | #define _FSIZE_T_DEFINED |
| 73 | #endif |
| 74 | |
| 75 | #ifndef _WFINDDATA_T_DEFINED |
| 76 | struct _wfinddata32_t { |
| 77 | unsigned attrib; |
| 78 | __time32_t time_create; |
| 79 | __time32_t time_access; |
| 80 | __time32_t time_write; |
| 81 | _fsize_t size; |
| 82 | wchar_t name[260]; |
| 83 | }; |
| 84 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 85 | struct _wfinddata32i64_t { |
| 86 | unsigned attrib; |
| 87 | __time32_t time_create; |
| 88 | __time32_t time_access; |
| 89 | __time32_t time_write; |
Kai Tietz | 12cda48 | 2009-09-06 12:02:08 +0000 | [diff] [blame] | 90 | __MINGW_EXTENSION __int64 size; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 91 | wchar_t name[260]; |
| 92 | }; |
| 93 | |
| 94 | struct _wfinddata64i32_t { |
| 95 | unsigned attrib; |
| 96 | __time64_t time_create; |
| 97 | __time64_t time_access; |
| 98 | __time64_t time_write; |
| 99 | _fsize_t size; |
| 100 | wchar_t name[260]; |
| 101 | }; |
| 102 | |
| 103 | struct _wfinddata64_t { |
| 104 | unsigned attrib; |
| 105 | __time64_t time_create; |
| 106 | __time64_t time_access; |
| 107 | __time64_t time_write; |
Kai Tietz | 12cda48 | 2009-09-06 12:02:08 +0000 | [diff] [blame] | 108 | __MINGW_EXTENSION __int64 size; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 109 | wchar_t name[260]; |
| 110 | }; |
Kai Tietz | 4d9b1cc | 2008-08-28 10:00:25 +0000 | [diff] [blame] | 111 | /* #endif */ |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 112 | |
| 113 | #ifdef _USE_32BIT_TIME_T |
| 114 | #define _wfinddata_t _wfinddata32_t |
| 115 | #define _wfinddatai64_t _wfinddata32i64_t |
| 116 | |
Martin Storsjö | eadcb62 | 2017-11-13 16:11:44 +0200 | [diff] [blame] | 117 | #define _wfindfirst _wfindfirst32 |
| 118 | #define _wfindnext _wfindnext32 |
Kai Tietz | 58e7c81 | 2009-08-27 07:13:57 +0000 | [diff] [blame] | 119 | #define _wfindfirst32i64 _wfindfirsti64 |
| 120 | #define _wfindnext32i64 _wfindnexti64 |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 121 | #else |
| 122 | #define _wfinddata_t _wfinddata64i32_t |
| 123 | #define _wfinddatai64_t _wfinddata64_t |
| 124 | |
| 125 | #define _wfindfirst _wfindfirst64i32 |
| 126 | #define _wfindnext _wfindnext64i32 |
| 127 | #define _wfindfirsti64 _wfindfirst64 |
| 128 | #define _wfindnexti64 _wfindnext64 |
| 129 | #endif |
| 130 | |
| 131 | #define _WFINDDATA_T_DEFINED |
| 132 | #endif |
| 133 | |
| 134 | #ifndef NULL |
| 135 | #ifdef __cplusplus |
Ozkan Sezer | c6f4772 | 2009-08-14 19:49:43 +0000 | [diff] [blame] | 136 | #ifndef _WIN64 |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 137 | #define NULL 0 |
| 138 | #else |
Ozkan Sezer | c6f4772 | 2009-08-14 19:49:43 +0000 | [diff] [blame] | 139 | #define NULL 0LL |
| 140 | #endif /* W64 */ |
| 141 | #else |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 142 | #define NULL ((void *)0) |
| 143 | #endif |
| 144 | #endif |
| 145 | |
| 146 | #ifndef _CONST_RETURN |
| 147 | #define _CONST_RETURN |
| 148 | #endif |
| 149 | |
| 150 | #define _WConst_return _CONST_RETURN |
| 151 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 152 | #ifndef _WDIRECT_DEFINED |
| 153 | #define _WDIRECT_DEFINED |
| 154 | |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 155 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 156 | #pragma push_macro("_wgetcwd") |
| 157 | #undef _wgetcwd |
| 158 | #pragma push_macro("_wgetdcwd") |
| 159 | #undef _wgetdcwd |
| 160 | #pragma push_macro("_wgetdcwd_nolock") |
| 161 | #undef _wgetdcwd_nolock |
| 162 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 163 | _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords); |
| 164 | _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords); |
Liu Hao | 2f9a134 | 2021-01-27 10:50:13 +0800 | [diff] [blame] | 165 | #if __MSVCRT_VERSION__ >= 0x800 |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 166 | wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords); |
Liu Hao | 2f9a134 | 2021-01-27 10:50:13 +0800 | [diff] [blame] | 167 | #endif |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 168 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 169 | #pragma pop_macro("_wgetcwd") |
| 170 | #pragma pop_macro("_wgetdcwd") |
| 171 | #pragma pop_macro("_wgetdcwd_nolock") |
| 172 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 173 | _CRTIMP int __cdecl _wchdir(const wchar_t *_Path); |
| 174 | _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path); |
| 175 | _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path); |
| 176 | #endif |
| 177 | |
| 178 | #ifndef _WIO_DEFINED |
| 179 | #define _WIO_DEFINED |
| 180 | |
| 181 | _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 182 | _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 183 | _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 184 | _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData); |
| 185 | _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData); |
| 186 | _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename); |
Kai Tietz | 1693b16 | 2011-11-23 10:31:21 +0000 | [diff] [blame] | 187 | _CRTIMP int __cdecl _wrename(const wchar_t *_OldFilename,const wchar_t *_NewFilename); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 188 | _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 189 | _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData); |
Kai Tietz | 0502984 | 2007-11-19 15:18:40 +0000 | [diff] [blame] | 190 | intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 191 | _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData); |
| 192 | _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData); |
Kai Tietz | 0502984 | 2007-11-19 15:18:40 +0000 | [diff] [blame] | 193 | int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 194 | _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 195 | _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 196 | _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 197 | _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 198 | #endif |
| 199 | |
| 200 | #ifndef _WLOCALE_DEFINED |
| 201 | #define _WLOCALE_DEFINED |
| 202 | _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale); |
| 203 | #endif |
| 204 | |
Biswapriyo Nath | 90da6c6 | 2025-03-23 08:45:03 +0000 | [diff] [blame] | 205 | #if __MSVCRT_VERSION__ >= 0xB00 |
| 206 | _CRTIMP _locale_t __cdecl _wcreate_locale(int _Category, const wchar_t *_Locale); |
| 207 | #endif |
| 208 | |
Steve Lhomme | 7c2e0a3 | 2020-04-20 08:45:59 +0200 | [diff] [blame] | 209 | #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP |
宋冬生 | 5cc9349 | 2014-11-11 13:39:28 +0800 | [diff] [blame] | 210 | #ifndef _WEXEC_DEFINED |
| 211 | #define _WEXEC_DEFINED |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 212 | _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...); |
| 213 | _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...); |
| 214 | _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...); |
| 215 | _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...); |
| 216 | _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList); |
| 217 | _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); |
| 218 | _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList); |
| 219 | _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); |
宋冬生 | 5cc9349 | 2014-11-11 13:39:28 +0800 | [diff] [blame] | 220 | #endif |
| 221 | |
| 222 | #ifndef _WSPAWN_DEFINED |
| 223 | #define _WSPAWN_DEFINED |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 224 | _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); |
| 225 | _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); |
| 226 | _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); |
| 227 | _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); |
| 228 | _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); |
| 229 | _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); |
| 230 | _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); |
| 231 | _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); |
宋冬生 | 5cc9349 | 2014-11-11 13:39:28 +0800 | [diff] [blame] | 232 | #endif |
| 233 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 234 | #ifndef _CRT_WSYSTEM_DEFINED |
| 235 | #define _CRT_WSYSTEM_DEFINED |
| 236 | _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); |
| 237 | #endif |
Steve Lhomme | 7c2e0a3 | 2020-04-20 08:45:59 +0200 | [diff] [blame] | 238 | #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */ |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 239 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 240 | #if !defined(_POSIX_) || defined(__GNUC__) |
| 241 | #ifndef _INO_T_DEFINED |
| 242 | #define _INO_T_DEFINED |
| 243 | typedef unsigned short _ino_t; |
| 244 | #ifndef NO_OLDNAMES |
| 245 | typedef unsigned short ino_t; |
| 246 | #endif |
| 247 | #endif |
| 248 | |
| 249 | #ifndef _DEV_T_DEFINED |
| 250 | #define _DEV_T_DEFINED |
| 251 | typedef unsigned int _dev_t; |
| 252 | #ifndef NO_OLDNAMES |
| 253 | typedef unsigned int dev_t; |
| 254 | #endif |
| 255 | #endif |
| 256 | |
Jonathan Yong | 4d3b28a | 2011-02-19 15:34:22 +0000 | [diff] [blame] | 257 | #include <_mingw_off_t.h> |
| 258 | #include <_mingw_stat64.h> |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 259 | |
| 260 | #ifndef _WSTAT_DEFINED |
| 261 | #define _WSTAT_DEFINED |
| 262 | |
| 263 | _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 264 | _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat); |
Pali Rohár | ec8fc48 | 2025-04-13 18:34:37 +0200 | [diff] [blame] | 265 | _CRTIMP int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 266 | _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat); |
| 267 | #endif |
| 268 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 269 | |
| 270 | #ifndef _WCONIO_DEFINED |
| 271 | #define _WCONIO_DEFINED |
| 272 | |
| 273 | #ifndef WEOF |
| 274 | #define WEOF (wint_t)(0xFFFF) |
| 275 | #endif |
| 276 | |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 277 | _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 278 | _CRTIMP wint_t __cdecl _getwch(void); |
| 279 | _CRTIMP wint_t __cdecl _getwche(void); |
| 280 | _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh); |
| 281 | _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh); |
| 282 | _CRTIMP int __cdecl _cputws(const wchar_t *_String); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 283 | _CRTIMP int __cdecl _cwprintf(const wchar_t * __restrict__ _Format,...); |
| 284 | _CRTIMP int __cdecl _cwscanf(const wchar_t * __restrict__ _Format,...); |
| 285 | _CRTIMP int __cdecl _cwscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 286 | _CRTIMP int __cdecl _vcwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 287 | _CRTIMP int __cdecl _cwprintf_p(const wchar_t * __restrict__ _Format,...); |
| 288 | _CRTIMP int __cdecl _vcwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 289 | |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 290 | _CRTIMP int __cdecl _cwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 291 | _CRTIMP int __cdecl _vcwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 292 | _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 293 | _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
Liu Hao | 2f9a134 | 2021-01-27 10:50:13 +0800 | [diff] [blame] | 294 | #if __MSVCRT_VERSION__ >= 0x800 |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 295 | wint_t __cdecl _putwch_nolock(wchar_t _WCh); |
| 296 | wint_t __cdecl _getwch_nolock(void); |
| 297 | wint_t __cdecl _getwche_nolock(void); |
| 298 | wint_t __cdecl _ungetwch_nolock(wint_t _WCh); |
| 299 | #endif |
Liu Hao | 2f9a134 | 2021-01-27 10:50:13 +0800 | [diff] [blame] | 300 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 301 | |
Steve Lhomme | b50da29 | 2020-04-20 08:46:06 +0200 | [diff] [blame] | 302 | #ifdef _UCRT |
| 303 | int __cdecl __stdio_common_vswprintf_p(unsigned __int64 _Options, wchar_t *_Str, size_t _Len, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList); |
| 304 | int __cdecl __stdio_common_vfwprintf_p(unsigned __int64 _Options, FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList); |
| 305 | #endif |
| 306 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 307 | #ifndef _WSTDIO_DEFINED |
| 308 | #define _WSTDIO_DEFINED |
| 309 | |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 310 | /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) |
| 311 | int __cdecl __mingw_swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...); |
| 312 | /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) |
| 313 | int __cdecl __mingw_vswscanf (const wchar_t * __restrict__ _Str,const wchar_t * __restrict__ Format,va_list argp); |
| 314 | /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) |
| 315 | int __cdecl __mingw_wscanf(const wchar_t * __restrict__ _Format,...); |
| 316 | /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) |
| 317 | int __cdecl __mingw_vwscanf(const wchar_t * __restrict__ Format, va_list argp); |
| 318 | /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) |
| 319 | int __cdecl __mingw_fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); |
| 320 | /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) |
| 321 | int __cdecl __mingw_vfwscanf (FILE * __restrict__ fp, const wchar_t * __restrict__ Format,va_list argp); |
| 322 | |
| 323 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 324 | /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) |
| 325 | int __cdecl __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); |
| 326 | /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) |
| 327 | int __cdecl __mingw_wprintf(const wchar_t * __restrict__ _Format,...); |
| 328 | /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) |
| 329 | int __cdecl __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 330 | /* __attribute__((__format__ (gnu_printf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) |
| 331 | int __cdecl __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 332 | /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) |
| 333 | int __cdecl __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...); |
| 334 | /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) |
| 335 | int __cdecl __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list); |
Pali Rohár | c85d64d | 2024-11-15 17:59:52 +0100 | [diff] [blame] | 336 | /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) |
| 337 | int __cdecl __mingw_swprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , ...); |
| 338 | /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) |
| 339 | int __cdecl __mingw_vswprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ ,va_list); |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 340 | |
Liu Hao | 61ce411 | 2020-05-17 14:20:28 +0800 | [diff] [blame] | 341 | /* __attribute__((__format__ (ms_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 342 | int __cdecl __ms_swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) |
| 343 | __MINGW_UCRT_ASM_CALL(swscanf); |
Pali Rohár | 2aec1a4 | 2024-12-14 19:53:31 +0100 | [diff] [blame] | 344 | /* __attribute__((__format__ (ms_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 345 | int __cdecl __ms_vswscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,va_list) |
Jacek Caban | 28d2ed3 | 2025-03-22 13:30:43 +0100 | [diff] [blame] | 346 | __MINGW_ASM_CALL(vswscanf); |
Liu Hao | 61ce411 | 2020-05-17 14:20:28 +0800 | [diff] [blame] | 347 | /* __attribute__((__format__ (ms_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 348 | int __cdecl __ms_wscanf(const wchar_t * __restrict__ _Format,...) |
| 349 | __MINGW_UCRT_ASM_CALL(wscanf); |
Pali Rohár | 2aec1a4 | 2024-12-14 19:53:31 +0100 | [diff] [blame] | 350 | /* __attribute__((__format__ (ms_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 351 | int __cdecl __ms_vwscanf(const wchar_t * __restrict__ _Format, va_list) |
Jacek Caban | 28d2ed3 | 2025-03-22 13:30:43 +0100 | [diff] [blame] | 352 | __MINGW_ASM_CALL(vwscanf); |
Liu Hao | 61ce411 | 2020-05-17 14:20:28 +0800 | [diff] [blame] | 353 | /* __attribute__((__format__ (ms_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 354 | int __cdecl __ms_fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) |
| 355 | __MINGW_UCRT_ASM_CALL(fwscanf); |
Pali Rohár | 2aec1a4 | 2024-12-14 19:53:31 +0100 | [diff] [blame] | 356 | /* __attribute__((__format__ (ms_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 357 | int __cdecl __ms_vfwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list) |
Jacek Caban | 28d2ed3 | 2025-03-22 13:30:43 +0100 | [diff] [blame] | 358 | __MINGW_ASM_CALL(vfwscanf); |
Liu Hao | 61ce411 | 2020-05-17 14:20:28 +0800 | [diff] [blame] | 359 | |
| 360 | /* __attribute__((__format__ (ms_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) |
| 361 | int __cdecl __ms_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 362 | /* No __MINGW_UCRT_ASM_CALL for __ms_fwprintf; this is provided as an |
| 363 | * actual function in the ucrt import libraries. */ |
Liu Hao | 61ce411 | 2020-05-17 14:20:28 +0800 | [diff] [blame] | 364 | /* __attribute__((__format__ (ms_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 365 | int __cdecl __ms_wprintf(const wchar_t * __restrict__ _Format,...) |
| 366 | __MINGW_UCRT_ASM_CALL(wprintf); |
Liu Hao | 61ce411 | 2020-05-17 14:20:28 +0800 | [diff] [blame] | 367 | /* __attribute__((__format__ (ms_wprintf, 2, 0))) */__MINGW_ATTRIB_NONNULL(2) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 368 | int __cdecl __ms_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList) |
| 369 | __MINGW_UCRT_ASM_CALL(vfwprintf); |
Liu Hao | 61ce411 | 2020-05-17 14:20:28 +0800 | [diff] [blame] | 370 | /*__attribute__((__format__ (ms_wprintf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 371 | int __cdecl __ms_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList) |
| 372 | __MINGW_UCRT_ASM_CALL(vwprintf); |
Pali Rohár | 73cf399 | 2024-11-15 17:59:51 +0100 | [diff] [blame] | 373 | /* __attribute__((__format__ (ms_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 374 | int __cdecl __ms_swprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , ...) |
| 375 | __MINGW_UCRT_ASM_CALL(swprintf); |
Pali Rohár | 73cf399 | 2024-11-15 17:59:51 +0100 | [diff] [blame] | 376 | /* __attribute__((__format__ (ms_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 377 | int __cdecl __ms_vswprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ ,va_list) |
| 378 | __MINGW_UCRT_ASM_CALL(vswprintf); |
Pali Rohár | 2aec1a4 | 2024-12-14 19:53:31 +0100 | [diff] [blame] | 379 | /* __attribute__((__format__ (ms_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 380 | int __cdecl __ms_snwprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , ...) |
| 381 | __MINGW_UCRT_ASM_CALL(snwprintf); |
Pali Rohár | 2aec1a4 | 2024-12-14 19:53:31 +0100 | [diff] [blame] | 382 | /* __attribute__((__format__ (ms_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) |
Martin Storsjö | 0b67589 | 2025-02-13 15:36:13 +0200 | [diff] [blame] | 383 | int __cdecl __ms_vsnwprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list) |
| 384 | __MINGW_UCRT_ASM_CALL(vsnwprintf); |
Liu Hao | 61ce411 | 2020-05-17 14:20:28 +0800 | [diff] [blame] | 385 | |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 386 | #ifdef _UCRT |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 387 | int __cdecl __stdio_common_vswprintf(unsigned __int64 options, wchar_t *str, size_t len, const wchar_t *format, _locale_t locale, va_list valist); |
| 388 | int __cdecl __stdio_common_vfwprintf(unsigned __int64 options, FILE *file, const wchar_t *format, _locale_t locale, va_list valist); |
| 389 | int __cdecl __stdio_common_vswscanf(unsigned __int64 options, const wchar_t *input, size_t length, const wchar_t *format, _locale_t locale, va_list valist); |
| 390 | int __cdecl __stdio_common_vfwscanf(unsigned __int64 options, FILE *file, const wchar_t *format, _locale_t locale, va_list valist); |
| 391 | #endif |
| 392 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 393 | #if __USE_MINGW_ANSI_STDIO |
Kai Tietz | 1ed6dcc | 2011-12-14 14:31:48 +0000 | [diff] [blame] | 394 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 395 | /* |
| 396 | * User has expressed a preference for C99 conformance... |
| 397 | */ |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 398 | /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) |
| 399 | int swscanf(const wchar_t *__source, const wchar_t *__format, ...) |
Martin Storsjö | 4517417 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 400 | __MINGW_ASM_CALL(__mingw_swscanf); |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 401 | |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 402 | /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) |
| 403 | int wscanf(const wchar_t *__format, ...) |
Martin Storsjö | 4517417 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 404 | __MINGW_ASM_CALL(__mingw_wscanf); |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 405 | |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 406 | /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) |
| 407 | int fwscanf(FILE *__stream, const wchar_t *__format, ...) |
Martin Storsjö | 4517417 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 408 | __MINGW_ASM_CALL(__mingw_fwscanf); |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 409 | |
| 410 | #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 411 | /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) |
| 412 | int vswscanf (const wchar_t *__source, const wchar_t *__format, __builtin_va_list __local_argv) |
Martin Storsjö | fd5c6d7 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 413 | __MINGW_ASM_CALL(__mingw_vswscanf); |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 414 | |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 415 | /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) |
| 416 | int vwscanf(const wchar_t *__format, __builtin_va_list __local_argv) |
Martin Storsjö | fd5c6d7 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 417 | __MINGW_ASM_CALL(__mingw_vwscanf); |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 418 | |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 419 | /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) |
| 420 | int vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) |
Martin Storsjö | fd5c6d7 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 421 | __MINGW_ASM_CALL(__mingw_vfwscanf); |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 422 | #endif /* __NO_ISOCEXT */ |
| 423 | |
| 424 | |
| 425 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 426 | /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) |
| 427 | int fwprintf (FILE *__stream, const wchar_t *__format, ...) |
Martin Storsjö | 4517417 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 428 | __MINGW_ASM_CALL(__mingw_fwprintf); |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 429 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 430 | /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) |
| 431 | int wprintf (const wchar_t *__format, ...) |
Martin Storsjö | 4517417 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 432 | __MINGW_ASM_CALL(__mingw_wprintf); |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 433 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 434 | /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) |
| 435 | int vfwprintf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) |
Martin Storsjö | fd5c6d7 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 436 | __MINGW_ASM_CALL(__mingw_vfwprintf); |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 437 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 438 | /* __attribute__((__format__ (gnu_wprintf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) |
| 439 | int vwprintf (const wchar_t *__format, __builtin_va_list __local_argv) |
Martin Storsjö | fd5c6d7 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 440 | __MINGW_ASM_CALL(__mingw_vwprintf); |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 441 | |
Pali Rohár | c85d64d | 2024-11-15 17:59:52 +0100 | [diff] [blame] | 442 | /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) |
| 443 | int swprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, ...) |
| 444 | __MINGW_ASM_CALL(__mingw_swprintf); |
| 445 | |
| 446 | /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) |
| 447 | int vswprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builtin_va_list __local_argv) |
| 448 | __MINGW_ASM_CALL(__mingw_vswprintf); |
| 449 | |
| 450 | #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ |
| 451 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 452 | /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) |
| 453 | int snwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, ...) |
Martin Storsjö | 4517417 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 454 | __MINGW_ASM_CALL(__mingw_snwprintf); |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 455 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 456 | /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) |
| 457 | int vsnwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builtin_va_list __local_argv) |
Martin Storsjö | fd5c6d7 | 2024-04-27 00:40:44 +0300 | [diff] [blame] | 458 | __MINGW_ASM_CALL(__mingw_vsnwprintf); |
Pali Rohár | c85d64d | 2024-11-15 17:59:52 +0100 | [diff] [blame] | 459 | |
| 460 | #endif /* __NO_ISOCEXT */ |
| 461 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 462 | #else /* !__USE_MINGW_ANSI_STDIO */ |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 463 | |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 464 | #ifdef _UCRT |
Martin Storsjö | e5f6f12 | 2025-03-20 14:31:24 +0200 | [diff] [blame] | 465 | __MINGW_ATTRIB_DEPRECATED_SEC_WARN |
| 466 | int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); |
| 467 | __MINGW_ATTRIB_DEPRECATED_SEC_WARN |
| 468 | int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...); |
| 469 | __MINGW_ATTRIB_DEPRECATED_SEC_WARN |
| 470 | int __cdecl wscanf(const wchar_t * __restrict__ _Format,...); |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 471 | __MINGW_ATTRIB_NONNULL(2) |
Martin Storsjö | e5f6f12 | 2025-03-20 14:31:24 +0200 | [diff] [blame] | 472 | int vfwscanf (FILE *__stream, const wchar_t *__format, va_list __local_argv); |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 473 | |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 474 | __MINGW_ATTRIB_NONNULL(2) |
Martin Storsjö | e5f6f12 | 2025-03-20 14:31:24 +0200 | [diff] [blame] | 475 | int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, va_list __local_argv); |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 476 | __MINGW_ATTRIB_NONNULL(1) |
Martin Storsjö | e5f6f12 | 2025-03-20 14:31:24 +0200 | [diff] [blame] | 477 | int vwscanf(const wchar_t *__format, va_list __local_argv); |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 478 | |
Martin Storsjö | 30c0b62 | 2024-04-22 14:59:51 +0300 | [diff] [blame] | 479 | int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); |
Martin Storsjö | 4fcc433 | 2025-03-20 14:02:48 +0200 | [diff] [blame] | 480 | int __cdecl wprintf(const wchar_t * __restrict__ _Format,...); |
| 481 | int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 482 | int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); |
Pali Rohár | 73cf399 | 2024-11-15 17:59:51 +0100 | [diff] [blame] | 483 | |
Martin Storsjö | 4fcc433 | 2025-03-20 14:02:48 +0200 | [diff] [blame] | 484 | int __cdecl swprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...); |
| 485 | int __cdecl vswprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args); |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 486 | #else |
| 487 | |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 488 | int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 489 | int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 490 | int __cdecl wscanf(const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 491 | #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ |
Kai Tietz | 1ed6dcc | 2011-12-14 14:31:48 +0000 | [diff] [blame] | 492 | __MINGW_ATTRIB_NONNULL(2) |
Jacek Caban | 28d2ed3 | 2025-03-22 13:30:43 +0100 | [diff] [blame] | 493 | int vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv); |
Kai Tietz | 1ed6dcc | 2011-12-14 14:31:48 +0000 | [diff] [blame] | 494 | |
Kai Tietz | 1ed6dcc | 2011-12-14 14:31:48 +0000 | [diff] [blame] | 495 | __MINGW_ATTRIB_NONNULL(2) |
Jacek Caban | 28d2ed3 | 2025-03-22 13:30:43 +0100 | [diff] [blame] | 496 | int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, __builtin_va_list __local_argv); |
| 497 | |
Kai Tietz | 1ed6dcc | 2011-12-14 14:31:48 +0000 | [diff] [blame] | 498 | __MINGW_ATTRIB_NONNULL(1) |
Jacek Caban | 28d2ed3 | 2025-03-22 13:30:43 +0100 | [diff] [blame] | 499 | int vwscanf(const wchar_t *__format, __builtin_va_list __local_argv); |
Kai Tietz | d4e56ae | 2011-11-04 14:33:37 +0000 | [diff] [blame] | 500 | #endif /* __NO_ISOCEXT */ |
| 501 | |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 502 | int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); |
| 503 | int __cdecl wprintf(const wchar_t * __restrict__ _Format,...); |
| 504 | int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 505 | int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); |
Pali Rohár | 73cf399 | 2024-11-15 17:59:51 +0100 | [diff] [blame] | 506 | |
| 507 | int __cdecl swprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...); |
| 508 | int __cdecl vswprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args); |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 509 | #endif /* _UCRT */ |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 510 | #endif /* __USE_MINGW_ANSI_STDIO */ |
| 511 | |
| 512 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 513 | #ifndef WEOF |
| 514 | #define WEOF (wint_t)(0xFFFF) |
| 515 | #endif |
| 516 | |
| 517 | #ifdef _POSIX_ |
| 518 | _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode); |
| 519 | #else |
| 520 | _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag); |
| 521 | #endif |
| 522 | |
Kai Tietz | 7fbd8c7 | 2007-10-16 14:38:02 +0000 | [diff] [blame] | 523 | wint_t __cdecl fgetwc(FILE *_File); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 524 | _CRTIMP wint_t __cdecl _fgetwchar(void); |
Kai Tietz | 7fbd8c7 | 2007-10-16 14:38:02 +0000 | [diff] [blame] | 525 | wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 526 | _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch); |
Kai Tietz | 7fbd8c7 | 2007-10-16 14:38:02 +0000 | [diff] [blame] | 527 | wint_t __cdecl getwc(FILE *_File); |
| 528 | wint_t __cdecl getwchar(void); |
| 529 | wint_t __cdecl putwc(wchar_t _Ch,FILE *_File); |
| 530 | wint_t __cdecl putwchar(wchar_t _Ch); |
| 531 | wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 532 | wchar_t *__cdecl fgetws(wchar_t * __restrict__ _Dst,int _SizeInWords,FILE * __restrict__ _File); |
| 533 | int __cdecl fputws(const wchar_t * __restrict__ _Str,FILE * __restrict__ _File); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 534 | _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 535 | _CRTIMP int __cdecl _putws(const wchar_t *_Str); |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 536 | |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 537 | #ifdef _UCRT |
Pali Rohár | 412f083 | 2025-05-04 11:37:23 +0200 | [diff] [blame] | 538 | _CRTIMP int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...); |
Martin Storsjö | 30c0b62 | 2024-04-22 14:59:51 +0300 | [diff] [blame] | 539 | int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Pali Rohár | 422942b | 2025-05-04 11:37:24 +0200 | [diff] [blame^] | 540 | _CRTIMP int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 541 | |
Mateusz | a84fc01 | 2018-11-02 21:01:43 +0100 | [diff] [blame] | 542 | #if __USE_MINGW_ANSI_STDIO == 0 |
Martin Storsjö | 4fcc433 | 2025-03-20 14:02:48 +0200 | [diff] [blame] | 543 | int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...); |
| 544 | int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg); |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 545 | #endif |
| 546 | |
| 547 | #else |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 548 | _CRTIMP int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 549 | _CRTIMP int __cdecl _swprintf_l(wchar_t * __restrict__ ,size_t _SizeInWords,const wchar_t * __restrict__ _Format,_locale_t _Locale,... ) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 550 | _CRTIMP int __cdecl _swprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,...); |
| 551 | _CRTIMP int __cdecl _vswprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 552 | _CRTIMP int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 553 | _CRTIMP int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 554 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 555 | #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 556 | |
Mateusz | a84fc01 | 2018-11-02 21:01:43 +0100 | [diff] [blame] | 557 | #if __USE_MINGW_ANSI_STDIO == 0 |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 558 | #pragma push_macro("snwprintf") |
| 559 | #pragma push_macro("vsnwprintf") |
| 560 | # undef snwprintf |
| 561 | # undef vsnwprintf |
Pali Rohár | c50df03 | 2024-11-15 17:59:53 +0100 | [diff] [blame] | 562 | int __cdecl snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...) __MINGW_ASM_CALL(__ms_snwprintf); |
| 563 | int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg) __MINGW_ASM_CALL(__ms_vsnwprintf); |
Kai Tietz | 999d9aa | 2011-11-04 12:26:43 +0000 | [diff] [blame] | 564 | #pragma pop_macro ("vsnwprintf") |
| 565 | #pragma pop_macro ("snwprintf") |
| 566 | #endif |
| 567 | |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 568 | #endif /* _UCRT */ |
Martin Storsjö | 265d0a5 | 2017-09-05 17:03:28 +0300 | [diff] [blame] | 569 | |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 570 | #endif /* _WSTDIO_DEFINED */ |
Kai Tietz | a68c420 | 2011-02-04 21:42:17 +0000 | [diff] [blame] | 571 | |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 572 | |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 573 | #ifdef _UCRT |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 574 | __mingw_ovr int __cdecl _vfwscanf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 575 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 576 | return __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _File, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 577 | } |
Biswapriyo Nath | 0b1c7cf | 2023-09-07 05:09:40 +0000 | [diff] [blame] | 578 | |
| 579 | __mingw_ovr int __cdecl _vwscanf_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 580 | { |
| 581 | return _vfwscanf_l(stdin, _Format, _Locale, _ArgList); |
| 582 | } |
| 583 | |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 584 | __mingw_ovr int __cdecl _fwscanf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, ...) |
| 585 | { |
| 586 | __builtin_va_list _ArgList; |
| 587 | int _Ret; |
| 588 | __builtin_va_start(_ArgList, _Locale); |
| 589 | _Ret = _vfwscanf_l(_File, _Format, _Locale, _ArgList); |
| 590 | __builtin_va_end(_ArgList); |
| 591 | return _Ret; |
| 592 | } |
| 593 | __mingw_ovr int __cdecl _wscanf_l(const wchar_t *_Format, _locale_t _Locale, ...) |
| 594 | { |
| 595 | __builtin_va_list _ArgList; |
| 596 | int _Ret; |
| 597 | __builtin_va_start(_ArgList, _Locale); |
| 598 | _Ret = _vfwscanf_l(stdin, _Format, _Locale, _ArgList); |
| 599 | __builtin_va_end(_ArgList); |
| 600 | return _Ret; |
| 601 | } |
| 602 | |
| 603 | __mingw_ovr int __cdecl _vsnwscanf_l(const wchar_t *_Src, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 604 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 605 | return __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Src, _MaxCount, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 606 | } |
| 607 | __mingw_ovr int __cdecl _snwscanf_l(const wchar_t *_Src, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...) |
| 608 | { |
| 609 | __builtin_va_list _ArgList; |
| 610 | int _Ret; |
| 611 | __builtin_va_start(_ArgList, _Locale); |
| 612 | _Ret = _vsnwscanf_l(_Src, _MaxCount, _Format, _Locale, _ArgList); |
| 613 | __builtin_va_end(_ArgList); |
| 614 | return _Ret; |
| 615 | } |
| 616 | __mingw_ovr int __cdecl _snwscanf(const wchar_t *_Src, size_t _MaxCount, const wchar_t *_Format, ...) |
| 617 | { |
| 618 | __builtin_va_list _ArgList; |
| 619 | int _Ret; |
| 620 | __builtin_va_start(_ArgList, _Format); |
| 621 | _Ret = _vsnwscanf_l(_Src, _MaxCount, _Format, NULL, _ArgList); |
| 622 | __builtin_va_end(_ArgList); |
| 623 | return _Ret; |
| 624 | } |
| 625 | |
| 626 | __mingw_ovr int __cdecl _vswscanf_l(const wchar_t *_Src, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 627 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 628 | return __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Src, (size_t)-1, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 629 | } |
| 630 | __mingw_ovr int __cdecl _swscanf_l(const wchar_t *_Src, const wchar_t *_Format, _locale_t _Locale, ...) |
| 631 | { |
| 632 | __builtin_va_list _ArgList; |
| 633 | int _Ret; |
| 634 | __builtin_va_start(_ArgList, _Locale); |
| 635 | _Ret = _vswscanf_l(_Src, _Format, _Locale, _ArgList); |
| 636 | __builtin_va_end(_ArgList); |
| 637 | return _Ret; |
| 638 | } |
| 639 | |
| 640 | __mingw_ovr int __cdecl _vfwprintf_p_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 641 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 642 | return __stdio_common_vfwprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _File, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 643 | } |
| 644 | __mingw_ovr int __cdecl _vwprintf_p_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 645 | { |
| 646 | return _vfwprintf_p_l(stdout, _Format, _Locale, _ArgList); |
| 647 | } |
| 648 | __mingw_ovr int __cdecl _vfwprintf_p(FILE *_File, const wchar_t *_Format, va_list _ArgList) |
| 649 | { |
| 650 | return _vfwprintf_p_l(_File, _Format, NULL, _ArgList); |
| 651 | } |
| 652 | __mingw_ovr int __cdecl _vwprintf_p(const wchar_t *_Format, va_list _ArgList) |
| 653 | { |
| 654 | return _vfwprintf_p_l(stdout, _Format, NULL, _ArgList); |
| 655 | } |
| 656 | __mingw_ovr int __cdecl _fwprintf_p_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, ...) |
| 657 | { |
| 658 | __builtin_va_list _ArgList; |
| 659 | int _Ret; |
| 660 | __builtin_va_start(_ArgList, _Locale); |
| 661 | _Ret = _vfwprintf_p_l(_File, _Format, _Locale, _ArgList); |
| 662 | __builtin_va_end(_ArgList); |
| 663 | return _Ret; |
| 664 | } |
| 665 | __mingw_ovr int __cdecl _wprintf_p_l(const wchar_t *_Format, _locale_t _Locale, ...) |
| 666 | { |
| 667 | __builtin_va_list _ArgList; |
| 668 | int _Ret; |
| 669 | __builtin_va_start(_ArgList, _Locale); |
| 670 | _Ret = _vfwprintf_p_l(stdout, _Format, _Locale, _ArgList); |
| 671 | __builtin_va_end(_ArgList); |
| 672 | return _Ret; |
| 673 | } |
| 674 | __mingw_ovr int __cdecl _fwprintf_p(FILE *_File, const wchar_t *_Format, ...) |
| 675 | { |
| 676 | __builtin_va_list _ArgList; |
| 677 | int _Ret; |
| 678 | __builtin_va_start(_ArgList, _Format); |
| 679 | _Ret = _vfwprintf_p_l(_File, _Format, NULL, _ArgList); |
| 680 | __builtin_va_end(_ArgList); |
| 681 | return _Ret; |
| 682 | } |
| 683 | __mingw_ovr int __cdecl _wprintf_p(const wchar_t *_Format, ...) |
| 684 | { |
| 685 | __builtin_va_list _ArgList; |
| 686 | int _Ret; |
| 687 | __builtin_va_start(_ArgList, _Format); |
| 688 | _Ret = _vfwprintf_p_l(stdout, _Format, NULL, _ArgList); |
| 689 | __builtin_va_end(_ArgList); |
| 690 | return _Ret; |
| 691 | } |
| 692 | |
| 693 | __mingw_ovr int __cdecl _vfwprintf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 694 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 695 | return __stdio_common_vfwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _File, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 696 | } |
| 697 | __mingw_ovr int __cdecl _vwprintf_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 698 | { |
| 699 | return _vfwprintf_l(stdout, _Format, _Locale, _ArgList); |
| 700 | } |
| 701 | __mingw_ovr int __cdecl _fwprintf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, ...) |
| 702 | { |
| 703 | __builtin_va_list _ArgList; |
| 704 | int _Ret; |
| 705 | __builtin_va_start(_ArgList, _Locale); |
| 706 | _Ret = _vfwprintf_l(_File, _Format, _Locale, _ArgList); |
| 707 | __builtin_va_end(_ArgList); |
| 708 | return _Ret; |
| 709 | } |
| 710 | __mingw_ovr int __cdecl _wprintf_l(const wchar_t *_Format, _locale_t _Locale, ...) |
| 711 | { |
| 712 | __builtin_va_list _ArgList; |
| 713 | int _Ret; |
| 714 | __builtin_va_start(_ArgList, _Locale); |
| 715 | _Ret = _vfwprintf_l(stdout, _Format, _Locale, _ArgList); |
| 716 | __builtin_va_end(_ArgList); |
| 717 | return _Ret; |
| 718 | } |
| 719 | |
| 720 | __mingw_ovr int __cdecl _vswprintf_p_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 721 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 722 | return __stdio_common_vswprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _DstBuf, _MaxCount, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 723 | } |
| 724 | __mingw_ovr int __cdecl _vswprintf_p(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, va_list _ArgList) |
| 725 | { |
| 726 | return _vswprintf_p_l(_DstBuf, _MaxCount, _Format, NULL, _ArgList); |
| 727 | } |
| 728 | __mingw_ovr int __cdecl _swprintf_p_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...) |
| 729 | { |
| 730 | __builtin_va_list _ArgList; |
| 731 | int _Ret; |
| 732 | __builtin_va_start(_ArgList, _Locale); |
| 733 | _Ret = _vswprintf_p_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList); |
| 734 | __builtin_va_end(_ArgList); |
| 735 | return _Ret; |
| 736 | } |
| 737 | __mingw_ovr int __cdecl _swprintf_p(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, ...) |
| 738 | { |
| 739 | __builtin_va_list _ArgList; |
| 740 | int _Ret; |
| 741 | __builtin_va_start(_ArgList, _Format); |
| 742 | _Ret = _vswprintf_p_l(_DstBuf, _MaxCount, _Format, NULL, _ArgList); |
| 743 | __builtin_va_end(_ArgList); |
| 744 | return _Ret; |
| 745 | } |
| 746 | |
| 747 | __mingw_ovr int __cdecl _vsnwprintf_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 748 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 749 | return __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _DstBuf, _MaxCount, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 750 | } |
| 751 | __mingw_ovr int __cdecl _snwprintf_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...) |
| 752 | { |
| 753 | __builtin_va_list _ArgList; |
| 754 | int _Ret; |
| 755 | __builtin_va_start(_ArgList, _Locale); |
| 756 | _Ret = _vsnwprintf_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList); |
| 757 | __builtin_va_end(_ArgList); |
| 758 | return _Ret; |
| 759 | } |
| 760 | |
| 761 | __mingw_ovr int __cdecl _vscwprintf_p_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 762 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 763 | return __stdio_common_vswprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 764 | } |
| 765 | __mingw_ovr int __cdecl _vscwprintf_p(const wchar_t *_Format, va_list _ArgList) |
| 766 | { |
| 767 | return _vscwprintf_p_l(_Format, NULL, _ArgList); |
| 768 | } |
| 769 | __mingw_ovr int __cdecl _scwprintf_p_l(const wchar_t *_Format, _locale_t _Locale, ...) |
| 770 | { |
| 771 | __builtin_va_list _ArgList; |
| 772 | int _Ret; |
| 773 | __builtin_va_start(_ArgList, _Locale); |
| 774 | _Ret = _vscwprintf_p_l(_Format, _Locale, _ArgList); |
| 775 | __builtin_va_end(_ArgList); |
| 776 | return _Ret; |
| 777 | } |
| 778 | __mingw_ovr int __cdecl _scwprintf_p(const wchar_t *_Format, ...) |
| 779 | { |
| 780 | __builtin_va_list _ArgList; |
| 781 | int _Ret; |
| 782 | __builtin_va_start(_ArgList, _Format); |
| 783 | _Ret = _vscwprintf_p_l(_Format, NULL, _ArgList); |
| 784 | __builtin_va_end(_ArgList); |
| 785 | return _Ret; |
| 786 | } |
| 787 | |
| 788 | __mingw_ovr int __cdecl _vscwprintf_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 789 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 790 | return __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 791 | } |
Pali Rohár | 412f083 | 2025-05-04 11:37:23 +0200 | [diff] [blame] | 792 | |
| 793 | _CRTIMP int __cdecl _vscwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 794 | |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 795 | __mingw_ovr int __cdecl _scwprintf_l(const wchar_t *_Format, _locale_t _Locale, ...) |
| 796 | { |
| 797 | __builtin_va_list _ArgList; |
| 798 | int _Ret; |
| 799 | __builtin_va_start(_ArgList, _Locale); |
| 800 | _Ret = _vscwprintf_l(_Format, _Locale, _ArgList); |
| 801 | __builtin_va_end(_ArgList); |
| 802 | return _Ret; |
| 803 | } |
| 804 | |
| 805 | __mingw_ovr int __cdecl _vswprintf_c_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 806 | { |
Jacek Caban | a523bb2 | 2020-06-07 15:21:18 +0200 | [diff] [blame] | 807 | return __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _DstBuf, _MaxCount, _Format, _Locale, _ArgList); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 808 | } |
| 809 | __mingw_ovr int __cdecl __vswprintf_l(wchar_t *_DstBuf, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 810 | { |
| 811 | return _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, _Locale, _ArgList); |
| 812 | } |
| 813 | __mingw_ovr int __cdecl _vswprintf_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList) |
| 814 | { |
| 815 | return _vswprintf_c_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList); |
| 816 | } |
Pali Rohár | c7da8d2 | 2025-05-04 11:37:22 +0200 | [diff] [blame] | 817 | _CRTIMP int __cdecl _vswprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,va_list _Args); |
Martin Storsjö | 66fab95 | 2017-11-24 13:58:21 +0200 | [diff] [blame] | 818 | __mingw_ovr int __cdecl _swprintf_c_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...) |
| 819 | { |
| 820 | __builtin_va_list _ArgList; |
| 821 | int _Ret; |
| 822 | __builtin_va_start(_ArgList, _Locale); |
| 823 | _Ret = _vswprintf_c_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList); |
| 824 | __builtin_va_end(_ArgList); |
| 825 | return _Ret; |
| 826 | } |
| 827 | __mingw_ovr int __cdecl __swprintf_l(wchar_t *_DstBuf, const wchar_t *_Format, _locale_t _Locale, ...) |
| 828 | { |
| 829 | __builtin_va_list _ArgList; |
| 830 | int _Ret; |
| 831 | __builtin_va_start(_ArgList, _Locale); |
| 832 | _Ret = _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, _Locale, _ArgList); |
| 833 | __builtin_va_end(_ArgList); |
| 834 | return _Ret; |
| 835 | } |
Pali Rohár | c7da8d2 | 2025-05-04 11:37:22 +0200 | [diff] [blame] | 836 | _CRTIMP int __cdecl _swprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,...); |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 837 | #else /* _UCRT */ |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 838 | _CRTIMP int __cdecl _fwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); |
| 839 | _CRTIMP int __cdecl _wprintf_p(const wchar_t * __restrict__ _Format,...); |
| 840 | _CRTIMP int __cdecl _vfwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 841 | _CRTIMP int __cdecl _vwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 842 | _CRTIMP int __cdecl _swprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,...); |
David Wohlferd | 6172d2f | 2016-08-26 17:31:14 -0700 | [diff] [blame] | 843 | _SECIMP int __cdecl _vswprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,va_list _ArgList); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 844 | _CRTIMP int __cdecl _scwprintf_p(const wchar_t * __restrict__ _Format,...); |
David Wohlferd | 6172d2f | 2016-08-26 17:31:14 -0700 | [diff] [blame] | 845 | _SECIMP int __cdecl _vscwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 846 | _CRTIMP int __cdecl _wprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 847 | _CRTIMP int __cdecl _wprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 848 | _CRTIMP int __cdecl _vwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 849 | _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 850 | _CRTIMP int __cdecl _fwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 851 | _CRTIMP int __cdecl _fwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 852 | _CRTIMP int __cdecl _vfwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 853 | _CRTIMP int __cdecl _vfwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 854 | _CRTIMP int __cdecl _swprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 855 | _CRTIMP int __cdecl _swprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 856 | _CRTIMP int __cdecl _vswprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 857 | _CRTIMP int __cdecl _vswprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 858 | _CRTIMP int __cdecl _scwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 859 | _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
| 860 | _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
| 861 | _CRTIMP int __cdecl _snwprintf_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
Ozkan Sezer | b4c77c4 | 2010-08-16 02:50:30 +0000 | [diff] [blame] | 862 | _CRTIMP int __cdecl _vsnwprintf_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 863 | _CRTIMP int __cdecl _swprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,...); |
| 864 | _CRTIMP int __cdecl _vswprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,va_list _Args); |
| 865 | _CRTIMP int __cdecl __swprintf_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,_locale_t _Plocinfo,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 866 | _CRTIMP int __cdecl _vswprintf_l(wchar_t * __restrict__ _Dest,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 867 | _CRTIMP int __cdecl __vswprintf_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,_locale_t _Plocinfo,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 868 | #endif /* !_UCRT */ |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 869 | |
Jacek Caban | 824ceb1 | 2012-11-30 11:16:49 +0000 | [diff] [blame] | 870 | #ifndef RC_INVOKED |
| 871 | #include <swprintf.inl> |
| 872 | #endif |
| 873 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 874 | #ifdef _CRT_NON_CONFORMING_SWPRINTFS |
| 875 | #ifndef __cplusplus |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 876 | #define _swprintf_l __swprintf_l |
| 877 | #define _vswprintf_l __vswprintf_l |
| 878 | #endif |
| 879 | #endif |
| 880 | |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 881 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 882 | #pragma push_macro("_wtempnam") |
| 883 | #undef _wtempnam |
| 884 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 885 | _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix); |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 886 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 887 | #pragma pop_macro("_wtempnam") |
| 888 | #endif |
| 889 | |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 890 | #ifndef _UCRT |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 891 | _CRTIMP int __cdecl _vscwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); |
| 892 | _CRTIMP int __cdecl _vscwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 893 | _CRTIMP int __cdecl _fwscanf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Ozkan Sezer | b4c77c4 | 2010-08-16 02:50:30 +0000 | [diff] [blame] | 894 | _CRTIMP int __cdecl _swscanf_l(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 895 | _CRTIMP int __cdecl _snwscanf(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,...); |
| 896 | _CRTIMP int __cdecl _snwscanf_l(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 897 | _CRTIMP int __cdecl _wscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Martin Storsjö | 5b06632 | 2019-05-04 13:36:33 +0300 | [diff] [blame] | 898 | #endif /* !_UCRT */ |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 899 | _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 900 | _CRTIMP FILE *__cdecl _wfopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 901 | _CRTIMP FILE *__cdecl _wfreopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode,FILE * __restrict__ _OldFile) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 902 | |
| 903 | #ifndef _CRT_WPERROR_DEFINED |
| 904 | #define _CRT_WPERROR_DEFINED |
| 905 | _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); |
| 906 | #endif |
| 907 | _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode); |
Kai Tietz | 9966c23 | 2007-08-21 08:33:12 +0000 | [diff] [blame] | 908 | #if !defined(NO_OLDNAMES) && !defined(wpopen) |
| 909 | #define wpopen _wpopen |
| 910 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 911 | _CRTIMP int __cdecl _wremove(const wchar_t *_Filename); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 912 | _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer); |
Liu Hao | 2f9a134 | 2021-01-27 10:50:13 +0800 | [diff] [blame] | 913 | #if __MSVCRT_VERSION__ >= 0x800 |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 914 | _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File); |
| 915 | _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File); |
| 916 | _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File); |
Liu Hao | 2f9a134 | 2021-01-27 10:50:13 +0800 | [diff] [blame] | 917 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 918 | |
| 919 | #undef _CRT_GETPUTWCHAR_NOINLINE |
| 920 | |
Kai Tietz | d730a17 | 2009-07-27 08:55:25 +0000 | [diff] [blame] | 921 | #if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) || defined (__CRT__NO_INLINE) |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 922 | #define getwchar() fgetwc(stdin) |
| 923 | #define putwchar(_c) fputwc((_c),stdout) |
| 924 | #else |
| 925 | __CRT_INLINE wint_t __cdecl getwchar() {return (fgetwc(stdin)); } |
| 926 | __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) {return (fputwc(_C,stdout)); } |
| 927 | #endif |
| 928 | |
| 929 | #define getwc(_stm) fgetwc(_stm) |
| 930 | #define putwc(_c,_stm) fputwc(_c,_stm) |
Liu Hao | 2f9a134 | 2021-01-27 10:50:13 +0800 | [diff] [blame] | 931 | #if __MSVCRT_VERSION__ >= 0x800 |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 932 | #define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm) |
| 933 | #define _getwc_nolock(_c) _fgetwc_nolock(_c) |
| 934 | #endif |
Liu Hao | 2f9a134 | 2021-01-27 10:50:13 +0800 | [diff] [blame] | 935 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 936 | |
| 937 | #ifndef _WSTDLIB_DEFINED |
| 938 | #define _WSTDLIB_DEFINED |
| 939 | |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 940 | _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 941 | _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 942 | _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 943 | _CRTIMP double __cdecl _wcstod_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,_locale_t _Locale); |
Kai Tietz | 1672408 | 2011-02-01 10:34:38 +0000 | [diff] [blame] | 944 | |
| 945 | double __cdecl __mingw_wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr); |
| 946 | float __cdecl __mingw_wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr); |
| 947 | long double __cdecl __mingw_wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__); |
| 948 | |
Martin Storsjö | b752897 | 2023-01-20 14:47:22 +0200 | [diff] [blame] | 949 | #if defined(__USE_MINGW_STRTOX) && !defined(_UCRT) |
Jonathan Yong | e09effa | 2013-01-11 16:20:29 +0000 | [diff] [blame] | 950 | __mingw_ovr |
| 951 | double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){ |
| 952 | return __mingw_wcstod(_Str,_EndPtr); |
| 953 | } |
| 954 | __mingw_ovr |
| 955 | float __cdecl wcstof(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){ |
| 956 | return __mingw_wcstof(_Str,_EndPtr); |
| 957 | } |
| 958 | /* wcstold is already a mingw implementation */ |
| 959 | #else |
| 960 | double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr); |
| 961 | float __cdecl wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr); |
Martin Storsjö | b752897 | 2023-01-20 14:47:22 +0200 | [diff] [blame] | 962 | #endif /* !defined(__USE_MINGW_STRTOX) || defined(_UCRT) */ |
NightStrike | 03376e0 | 2008-04-25 23:01:50 +0000 | [diff] [blame] | 963 | #if !defined __NO_ISOCEXT /* in libmingwex.a */ |
NightStrike | 03376e0 | 2008-04-25 23:01:50 +0000 | [diff] [blame] | 964 | long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 965 | #endif /* __NO_ISOCEXT */ |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 966 | long __cdecl wcstol(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix); |
| 967 | _CRTIMP long __cdecl _wcstol_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); |
| 968 | unsigned long __cdecl wcstoul(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix); |
| 969 | _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 970 | _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 971 | #ifndef _CRT_WSYSTEM_DEFINED |
| 972 | #define _CRT_WSYSTEM_DEFINED |
| 973 | _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); |
| 974 | #endif |
| 975 | _CRTIMP double __cdecl _wtof(const wchar_t *_Str); |
| 976 | _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale); |
| 977 | _CRTIMP int __cdecl _wtoi(const wchar_t *_Str); |
| 978 | _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale); |
| 979 | _CRTIMP long __cdecl _wtol(const wchar_t *_Str); |
| 980 | _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale); |
| 981 | |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 982 | __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | 12cda48 | 2009-09-06 12:02:08 +0000 | [diff] [blame] | 983 | __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix); |
| 984 | __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str); |
| 985 | __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale); |
| 986 | __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); |
| 987 | __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); |
| 988 | __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); |
| 989 | __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 990 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 991 | |
| 992 | #ifndef _POSIX_ |
| 993 | #ifndef _WSTDLIBP_DEFINED |
| 994 | #define _WSTDLIBP_DEFINED |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 995 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 996 | #pragma push_macro("_wfullpath") |
| 997 | #undef _wfullpath |
| 998 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 999 | _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords); |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 1000 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 1001 | #pragma pop_macro("_wfullpath") |
| 1002 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1003 | _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); |
| 1004 | #ifndef _CRT_WPERROR_DEFINED |
| 1005 | #define _CRT_WPERROR_DEFINED |
| 1006 | _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); |
| 1007 | #endif |
| 1008 | _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1009 | _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1010 | _CRTIMP void __cdecl _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1011 | #endif |
| 1012 | #endif |
| 1013 | |
| 1014 | #ifndef _WSTRING_DEFINED |
| 1015 | #define _WSTRING_DEFINED |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 1016 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 1017 | #pragma push_macro("_wcsdup") |
| 1018 | #undef _wcsdup |
| 1019 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1020 | _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str); |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 1021 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 1022 | #pragma pop_macro("_wcsdup") |
| 1023 | #endif |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1024 | wchar_t *__cdecl wcscat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | e274bb1 | 2007-10-18 12:13:09 +0000 | [diff] [blame] | 1025 | _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch); |
| 1026 | int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1027 | wchar_t *__cdecl wcscpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | e274bb1 | 2007-10-18 12:13:09 +0000 | [diff] [blame] | 1028 | size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control); |
| 1029 | size_t __cdecl wcslen(const wchar_t *_Str); |
| 1030 | size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1031 | wchar_t *__cdecl wcsncat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | e274bb1 | 2007-10-18 12:13:09 +0000 | [diff] [blame] | 1032 | int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1033 | wchar_t *__cdecl wcsncpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1034 | wchar_t *__cdecl _wcsncpy_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | e274bb1 | 2007-10-18 12:13:09 +0000 | [diff] [blame] | 1035 | _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control); |
| 1036 | _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch); |
| 1037 | size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control); |
| 1038 | _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr); |
Pali Rohár | bafccb4 | 2024-11-15 17:59:49 +0100 | [diff] [blame] | 1039 | wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim,wchar_t ** __restrict__ _Ptr) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1040 | wchar_t *__cdecl _wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1041 | #if defined(_CRT_NON_CONFORMING_WCSTOK) && !defined(__cplusplus) |
| 1042 | #define wcstok _wcstok |
| 1043 | #endif |
| 1044 | #if !defined(_CRT_NO_INLINE_DEPRECATED_WCSTOK) && defined(__cplusplus) |
| 1045 | extern "C++" inline wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) { return _wcstok(_Str, _Delim); } |
Martin Storsjö | 7a2c474 | 2021-02-26 10:33:43 +0200 | [diff] [blame] | 1046 | #endif |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1047 | _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1048 | _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1049 | _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); |
| 1050 | _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); |
| 1051 | _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); |
| 1052 | _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1053 | _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1054 | _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1055 | _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1056 | _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1057 | _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1058 | _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1059 | _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1060 | size_t __cdecl wcsxfrm(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount); |
| 1061 | _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount,_locale_t _Locale); |
Kai Tietz | e274bb1 | 2007-10-18 12:13:09 +0000 | [diff] [blame] | 1062 | int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1063 | _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); |
| 1064 | _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); |
| 1065 | _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); |
| 1066 | _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); |
| 1067 | _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); |
| 1068 | _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); |
| 1069 | _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); |
| 1070 | |
| 1071 | #ifndef NO_OLDNAMES |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 1072 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 1073 | #pragma push_macro("wcsdup") |
| 1074 | #undef wcsdup |
| 1075 | #endif |
Jonathan Yong | ff428b3 | 2009-10-16 12:19:21 +0000 | [diff] [blame] | 1076 | wchar_t *__cdecl wcsdup(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; |
Pali Rohár | 172495c | 2024-11-27 14:28:47 +0100 | [diff] [blame] | 1077 | #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) |
| 1078 | #pragma pop_macro("wcsdup") |
| 1079 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1080 | #define wcswcs wcsstr |
Jonathan Yong | ff428b3 | 2009-10-16 12:19:21 +0000 | [diff] [blame] | 1081 | int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005; |
| 1082 | int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005; |
| 1083 | wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005; |
| 1084 | wchar_t *__cdecl wcsrev(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; |
| 1085 | wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_MSVC2005; |
| 1086 | wchar_t *__cdecl wcslwr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; |
| 1087 | wchar_t *__cdecl wcsupr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; |
| 1088 | int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1089 | #endif |
| 1090 | #endif |
| 1091 | |
| 1092 | #ifndef _TM_DEFINED |
| 1093 | #define _TM_DEFINED |
| 1094 | struct tm { |
| 1095 | int tm_sec; |
| 1096 | int tm_min; |
| 1097 | int tm_hour; |
| 1098 | int tm_mday; |
| 1099 | int tm_mon; |
| 1100 | int tm_year; |
| 1101 | int tm_wday; |
| 1102 | int tm_yday; |
| 1103 | int tm_isdst; |
| 1104 | }; |
| 1105 | #endif |
| 1106 | |
| 1107 | #ifndef _WTIME_DEFINED |
| 1108 | #define _WTIME_DEFINED |
| 1109 | |
| 1110 | _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm); |
David Wohlferd | 6172d2f | 2016-08-26 17:31:14 -0700 | [diff] [blame] | 1111 | _SECIMP errno_t __cdecl _wasctime_s (wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1112 | wchar_t *__cdecl _wctime32(const __time32_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
David Wohlferd | 6172d2f | 2016-08-26 17:31:14 -0700 | [diff] [blame] | 1113 | _SECIMP errno_t __cdecl _wctime32_s (wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1114 | size_t __cdecl wcsftime(wchar_t * __restrict__ _Buf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,const struct tm * __restrict__ _Tm); |
| 1115 | _CRTIMP size_t __cdecl _wcsftime_l(wchar_t * __restrict__ _Buf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,const struct tm * __restrict__ _Tm,_locale_t _Locale); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1116 | _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
David Wohlferd | 6172d2f | 2016-08-26 17:31:14 -0700 | [diff] [blame] | 1117 | _SECIMP errno_t __cdecl _wstrdate_s (wchar_t *_Buf,size_t _SizeInWords); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1118 | _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
David Wohlferd | 6172d2f | 2016-08-26 17:31:14 -0700 | [diff] [blame] | 1119 | _SECIMP errno_t __cdecl _wstrtime_s (wchar_t *_Buf,size_t _SizeInWords); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1120 | _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
David Wohlferd | 6172d2f | 2016-08-26 17:31:14 -0700 | [diff] [blame] | 1121 | _SECIMP errno_t __cdecl _wctime64_s (wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1122 | |
Kai Tietz | 738b65c | 2007-08-14 15:55:23 +0000 | [diff] [blame] | 1123 | #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL) |
| 1124 | #define _INC_WTIME_INL |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1125 | wchar_t *__cdecl _wctime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | d730a17 | 2009-07-27 08:55:25 +0000 | [diff] [blame] | 1126 | #ifndef __CRT__NO_INLINE |
Kai Tietz | c2413cc | 2009-09-17 09:20:10 +0000 | [diff] [blame] | 1127 | #ifndef _USE_32BIT_TIME_T |
Kai Tietz | 9312633 | 2009-08-23 16:52:19 +0000 | [diff] [blame] | 1128 | __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); } |
Kai Tietz | d730a17 | 2009-07-27 08:55:25 +0000 | [diff] [blame] | 1129 | #else |
Kai Tietz | c2413cc | 2009-09-17 09:20:10 +0000 | [diff] [blame] | 1130 | __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); } |
Kai Tietz | 738b65c | 2007-08-14 15:55:23 +0000 | [diff] [blame] | 1131 | #endif |
Kai Tietz | c2413cc | 2009-09-17 09:20:10 +0000 | [diff] [blame] | 1132 | #endif /* __CRT__NO_INLINE */ |
Kai Tietz | 738b65c | 2007-08-14 15:55:23 +0000 | [diff] [blame] | 1133 | #endif |
David Wohlferd | f45d2b6 | 2016-08-25 13:53:52 -0700 | [diff] [blame] | 1134 | |
| 1135 | #if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) |
| 1136 | #define _INC_WTIME_S_INL |
| 1137 | errno_t __cdecl _wctime_s(wchar_t *, size_t, const time_t *); |
| 1138 | #ifndef __CRT__NO_INLINE |
| 1139 | #ifndef _USE_32BIT_TIME_T |
| 1140 | __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s (_Buffer,_SizeInWords,_Time); } |
| 1141 | #else |
| 1142 | __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s (_Buffer,_SizeInWords,_Time); } |
| 1143 | #endif /* _USE_32BIT_TIME_T */ |
| 1144 | #endif /* __CRT__NO_INLINE */ |
| 1145 | #endif /* !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) */ |
| 1146 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1147 | #endif |
| 1148 | |
Martin Storsjö | 211af1e | 2019-10-28 23:25:13 +0200 | [diff] [blame] | 1149 | #if defined(_UCRT) || defined(__LARGE_MBSTATE_T) |
| 1150 | typedef struct _Mbstatet { |
| 1151 | unsigned long _Wchar; |
| 1152 | unsigned short _Byte, _State; |
| 1153 | } _Mbstatet; |
| 1154 | typedef _Mbstatet mbstate_t; |
| 1155 | #else |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1156 | typedef int mbstate_t; |
Martin Storsjö | 211af1e | 2019-10-28 23:25:13 +0200 | [diff] [blame] | 1157 | #endif |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1158 | typedef wchar_t _Wint_t; |
| 1159 | |
| 1160 | wint_t __cdecl btowc(int); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1161 | size_t __cdecl mbrlen(const char * __restrict__ _Ch,size_t _SizeInBytes,mbstate_t * __restrict__ _State); |
| 1162 | size_t __cdecl mbrtowc(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SizeInBytes,mbstate_t * __restrict__ _State); |
| 1163 | size_t __cdecl mbsrtowcs(wchar_t * __restrict__ _Dest,const char ** __restrict__ _PSrc,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1164 | size_t __cdecl wcrtomb(char * __restrict__ _Dest,wchar_t _Source,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
| 1165 | size_t __cdecl wcsrtombs(char * __restrict__ _Dest,const wchar_t ** __restrict__ _PSource,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1166 | int __cdecl wctob(wint_t _WCh); |
| 1167 | |
| 1168 | #ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ |
| 1169 | wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n); |
| 1170 | _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n); |
Kai Tietz | bd1b5a2 | 2012-06-15 07:41:39 +0000 | [diff] [blame] | 1171 | int __cdecl wmemcmp(const wchar_t *s1, const wchar_t *s2,size_t n); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1172 | wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ s1,const wchar_t * __restrict__ s2,size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | 4d4005a | 2011-03-25 09:30:29 +0000 | [diff] [blame] | 1173 | wchar_t * __cdecl wmempcpy (wchar_t *_Dst, const wchar_t *_Src, size_t _Size); |
Jonathan Yong | 116470f | 2009-12-03 08:43:40 +0000 | [diff] [blame] | 1174 | wchar_t *__cdecl wmemmove(wchar_t *s1, const wchar_t *s2, size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Ozkan Sezer | c95a31f | 2009-07-28 08:41:49 +0000 | [diff] [blame] | 1175 | int __cdecl fwide(FILE *stream,int mode); |
Martin Storsjö | 211af1e | 2019-10-28 23:25:13 +0200 | [diff] [blame] | 1176 | #if defined(_UCRT) || defined(__LARGE_MBSTATE_T) |
| 1177 | /* With UCRT, mbsinit is only available as inline. */ |
Martin Storsjö | 1652e92 | 2024-04-23 16:13:18 +0300 | [diff] [blame] | 1178 | __mingw_ovr int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || _P->_Wchar == 0); } |
Martin Storsjö | 211af1e | 2019-10-28 23:25:13 +0200 | [diff] [blame] | 1179 | #else |
Ozkan Sezer | c95a31f | 2009-07-28 08:41:49 +0000 | [diff] [blame] | 1180 | int __cdecl mbsinit(const mbstate_t *ps); |
Martin Storsjö | 211af1e | 2019-10-28 23:25:13 +0200 | [diff] [blame] | 1181 | #endif |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1182 | __MINGW_EXTENSION long long __cdecl wcstoll(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base); |
| 1183 | __MINGW_EXTENSION unsigned long long __cdecl wcstoull(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base); |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1184 | #endif /* __NO_ISOCEXT */ |
| 1185 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1186 | void *__cdecl memmove(void *_Dst,const void *_Src,size_t _MaxCount); |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1187 | void *__cdecl memcpy(void * __restrict__ _Dst,const void * __restrict__ _Src,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; |
Kai Tietz | d730a17 | 2009-07-27 08:55:25 +0000 | [diff] [blame] | 1188 | #ifndef __CRT__NO_INLINE |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1189 | __CRT_INLINE int __cdecl fwide(FILE *_F,int _M) { (void)_F; return (_M); } |
Martin Storsjö | 211af1e | 2019-10-28 23:25:13 +0200 | [diff] [blame] | 1190 | #if !defined(_UCRT) && !defined(__LARGE_MBSTATE_T) |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1191 | __CRT_INLINE int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || *_P==0); } |
Martin Storsjö | 211af1e | 2019-10-28 23:25:13 +0200 | [diff] [blame] | 1192 | #endif |
Ozkan Sezer | d350743 | 2009-07-28 09:11:16 +0000 | [diff] [blame] | 1193 | __CRT_INLINE _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *_S,wchar_t _C,size_t _N) { |
Kai Tietz | 69faf7c | 2009-08-17 08:13:50 +0000 | [diff] [blame] | 1194 | if (_S) { |
Ozkan Sezer | d350743 | 2009-07-28 09:11:16 +0000 | [diff] [blame] | 1195 | for ( ; 0 < _N; ++_S, --_N) |
| 1196 | if (*_S == _C) |
| 1197 | return (_CONST_RETURN wchar_t *)(_S); |
| 1198 | } |
Kai Tietz | 69faf7c | 2009-08-17 08:13:50 +0000 | [diff] [blame] | 1199 | return (_CONST_RETURN wchar_t *) NULL; |
Ozkan Sezer | d350743 | 2009-07-28 09:11:16 +0000 | [diff] [blame] | 1200 | } |
| 1201 | __CRT_INLINE int __cdecl wmemcmp(const wchar_t *_S1,const wchar_t *_S2,size_t _N) { |
| 1202 | if (_N == 0 || _S1 == _S2) |
Kai Tietz | 69faf7c | 2009-08-17 08:13:50 +0000 | [diff] [blame] | 1203 | return 0; /* even for NULL pointers. */ |
| 1204 | if ((_S1 && !(_S2)) || (_S2 && !(_S1))) |
Kai Tietz | 3114877 | 2009-08-17 08:57:22 +0000 | [diff] [blame] | 1205 | return !(_S2) ? 1 : -1; /* robust. */ |
Ozkan Sezer | d350743 | 2009-07-28 09:11:16 +0000 | [diff] [blame] | 1206 | for ( ; 0 < _N; ++_S1, ++_S2, --_N) |
Ozkan Sezer | bb8290d | 2009-07-28 09:33:36 +0000 | [diff] [blame] | 1207 | if (*_S1 != *_S2) |
Ozkan Sezer | d350743 | 2009-07-28 09:11:16 +0000 | [diff] [blame] | 1208 | return (*_S1 < *_S2 ? -1 : +1); |
Ozkan Sezer | bb8290d | 2009-07-28 09:33:36 +0000 | [diff] [blame] | 1209 | return 0; |
Ozkan Sezer | d350743 | 2009-07-28 09:11:16 +0000 | [diff] [blame] | 1210 | } |
Kai Tietz | c93f153 | 2010-08-14 10:43:15 +0000 | [diff] [blame] | 1211 | __CRT_INLINE wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ _S1,const wchar_t * __restrict__ _S2,size_t _N) |
| 1212 | { |
| 1213 | return (wchar_t *) memcpy (_S1,_S2,_N*sizeof(wchar_t)); |
| 1214 | } |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1215 | __CRT_INLINE wchar_t *__cdecl wmemmove(wchar_t *_S1,const wchar_t *_S2,size_t _N) { return (wchar_t *)memmove(_S1,_S2,_N*sizeof(wchar_t)); } |
| 1216 | __CRT_INLINE wchar_t *__cdecl wmemset(wchar_t *_S,wchar_t _C,size_t _N) { |
| 1217 | wchar_t *_Su = _S; |
| 1218 | for (;0<_N;++_Su,--_N) { |
| 1219 | *_Su = _C; |
| 1220 | } |
| 1221 | return (_S); |
| 1222 | } |
Kai Tietz | d730a17 | 2009-07-27 08:55:25 +0000 | [diff] [blame] | 1223 | #endif /* !__CRT__NO_INLINE */ |
Jonathan Yong | d28bd37 | 2011-01-29 11:22:42 +0000 | [diff] [blame] | 1224 | |
| 1225 | #ifndef __MINGW_MBWC_CONVERT_DEFINED |
| 1226 | #define __MINGW_MBWC_CONVERT_DEFINED |
| 1227 | |
| 1228 | /** |
| 1229 | * __mingw_str_wide_utf8 |
| 1230 | * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent. |
| 1231 | * Caller is supposed to free allocated buffer with __mingw_str_free(). |
| 1232 | * @param[in] wptr Pointer to wide string. |
| 1233 | * @param[out] mbptr Pointer to multibyte string. |
| 1234 | * @param[out] buflen Optional parameter for length of allocated buffer. |
| 1235 | * @return bytes written by WideCharToMultiByte conversion, 0 for failure. |
| 1236 | * |
| 1237 | * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx |
| 1238 | */ |
| 1239 | int __cdecl __mingw_str_wide_utf8 (const wchar_t * const wptr, char **mbptr, size_t * buflen); |
| 1240 | |
| 1241 | /** |
| 1242 | * __mingw_str_utf8_wide |
| 1243 | * Converts a null terminated UTF-8 string to a UCS-2 equivalent. |
| 1244 | * Caller is supposed to free allocated buffer with __mingw_str_free(). |
| 1245 | * @param[out] mbptr Pointer to multibyte string. |
| 1246 | * @param[in] wptr Pointer to wide string. |
| 1247 | * @param[out] buflen Optional parameter for length of allocated buffer. |
| 1248 | * @return bytes written by WideCharToMultiByte conversion, 0 for failure. |
| 1249 | * |
| 1250 | * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx |
| 1251 | */ |
| 1252 | |
| 1253 | int __cdecl __mingw_str_utf8_wide (const char *const mbptr, wchar_t ** wptr, size_t * buflen); |
| 1254 | |
| 1255 | /** |
| 1256 | * __mingw_str_free |
| 1257 | * Frees buffer create by __mingw_str_wide_utf8 and __mingw_str_utf8_wide. |
| 1258 | * @param[in] ptr memory block to free. |
| 1259 | * |
| 1260 | */ |
| 1261 | |
| 1262 | void __cdecl __mingw_str_free(void *ptr); |
| 1263 | |
| 1264 | #endif /* __MINGW_MBWC_CONVERT_DEFINED */ |
| 1265 | |
Kai Tietz | edaa25e | 2007-08-23 09:28:16 +0000 | [diff] [blame] | 1266 | #ifdef __cplusplus |
| 1267 | } |
| 1268 | #endif |
| 1269 | |
| 1270 | #pragma pack(pop) |
Kai Tietz | e274bb1 | 2007-10-18 12:13:09 +0000 | [diff] [blame] | 1271 | |
Kai Tietz | 6568519 | 2007-10-18 13:23:49 +0000 | [diff] [blame] | 1272 | #include <sec_api/wchar_s.h> |
Ozkan Sezer | 20b9081 | 2010-07-22 20:30:46 +0000 | [diff] [blame] | 1273 | |
| 1274 | #endif /* _INC_WCHAR */ |
| 1275 | |