master
   1/**
   2 * This file has no copyright assigned and is placed in the Public Domain.
   3 * This file is part of the mingw-w64 runtime package.
   4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
   5 */
   6#ifndef _INC_WCHAR
   7#define _INC_WCHAR
   8
   9#include <corecrt.h>
  10#include <corecrt_stdio_config.h>
  11#include <corecrt_wstdlib.h>
  12#include <corecrt_wctype.h>
  13
  14#if __USE_MINGW_ANSI_STDIO && !defined (__USE_MINGW_STRTOX) && !defined(_CRTBLD)
  15#define __USE_MINGW_STRTOX 1
  16#endif
  17
  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 */
  25#endif /* defined(__LIBMSVCRT__) */
  26
  27#pragma pack(push,_CRT_PACKING)
  28
  29#ifdef __cplusplus
  30extern "C" {
  31#endif
  32
  33#ifndef WCHAR_MIN  /* also in stdint.h */
  34#define WCHAR_MIN 0U
  35#define WCHAR_MAX 0xffffU
  36#endif
  37
  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
  57_CRTIMP FILE *__cdecl __acrt_iob_func(unsigned index);
  58#ifndef _STDIO_DEFINED
  59  _CRTIMP FILE *__cdecl __iob_func(void);
  60#define _iob __iob_func()
  61#endif
  62
  63#ifndef _STDSTREAM_DEFINED
  64#define stdin (__acrt_iob_func(0))
  65#define stdout (__acrt_iob_func(1))
  66#define stderr (__acrt_iob_func(2))
  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
  85  struct _wfinddata32i64_t {
  86    unsigned attrib;
  87    __time32_t time_create;
  88    __time32_t time_access;
  89    __time32_t time_write;
  90    __MINGW_EXTENSION __int64 size;
  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;
 108    __MINGW_EXTENSION __int64 size;
 109    wchar_t name[260];
 110  };
 111/* #endif */
 112
 113#ifdef _USE_32BIT_TIME_T
 114#define _wfinddata_t _wfinddata32_t
 115#define _wfinddatai64_t _wfinddata32i64_t
 116
 117#define _wfindfirst _wfindfirst32
 118#define _wfindnext _wfindnext32
 119#define _wfindfirst32i64 _wfindfirsti64
 120#define _wfindnext32i64 _wfindnexti64
 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
 136#ifndef _WIN64
 137#define NULL 0
 138#else
 139#define NULL 0LL
 140#endif  /* W64 */
 141#else
 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
 152#ifndef _WDIRECT_DEFINED
 153#define _WDIRECT_DEFINED
 154
 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
 163  _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords);
 164  _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
 165#if __MSVCRT_VERSION__ >= 0x800
 166  wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
 167#endif
 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
 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);
 182  _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode);
 183  _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 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);
 187  _CRTIMP int __cdecl _wrename(const wchar_t *_OldFilename,const wchar_t *_NewFilename);
 188  _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 189  _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData);
 190  intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData);
 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);
 193  int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData);
 194  _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData);
 195  _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag);
 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;
 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
 205#if __MSVCRT_VERSION__ >= 0xB00
 206  _CRTIMP _locale_t __cdecl _wcreate_locale(int _Category, const wchar_t *_Locale);
 207#endif
 208
 209#ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
 210#ifndef _WEXEC_DEFINED
 211#define _WEXEC_DEFINED
 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);
 220#endif
 221
 222#ifndef _WSPAWN_DEFINED
 223#define _WSPAWN_DEFINED
 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);
 232#endif
 233
 234#ifndef _CRT_WSYSTEM_DEFINED
 235#define _CRT_WSYSTEM_DEFINED
 236  _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
 237#endif
 238#endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
 239
 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
 257#include <_mingw_off_t.h>
 258#include <_mingw_stat64.h>
 259
 260#ifndef _WSTAT_DEFINED
 261#define _WSTAT_DEFINED
 262
 263  _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat);
 264  _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat);
 265  _CRTIMP int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat);
 266  _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
 267#endif
 268#endif
 269
 270#ifndef _WCONIO_DEFINED
 271#define _WCONIO_DEFINED
 272
 273#ifndef WEOF
 274#define WEOF (wint_t)(0xFFFF)
 275#endif
 276
 277  _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 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);
 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);
 289
 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);
 294#if __MSVCRT_VERSION__ >= 0x800
 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
 300#endif
 301
 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
 307#ifndef _WSTDIO_DEFINED
 308#define _WSTDIO_DEFINED
 309
 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
 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);
 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);
 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);
 340
 341/* __attribute__((__format__ (ms_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
 342  int __cdecl __ms_swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...)
 343  __MINGW_UCRT_ASM_CALL(swscanf);
 344/* __attribute__((__format__ (ms_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
 345  int __cdecl __ms_vswscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,va_list)
 346  __MINGW_ASM_CALL(vswscanf);
 347/* __attribute__((__format__ (ms_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
 348  int __cdecl __ms_wscanf(const wchar_t * __restrict__ _Format,...)
 349  __MINGW_UCRT_ASM_CALL(wscanf);
 350/* __attribute__((__format__ (ms_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
 351  int __cdecl __ms_vwscanf(const wchar_t * __restrict__ _Format, va_list)
 352  __MINGW_ASM_CALL(vwscanf);
 353/* __attribute__((__format__ (ms_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
 354  int __cdecl __ms_fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...)
 355  __MINGW_UCRT_ASM_CALL(fwscanf);
 356/* __attribute__((__format__ (ms_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
 357  int __cdecl __ms_vfwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list)
 358  __MINGW_ASM_CALL(vfwscanf);
 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,...);
 362  /* No __MINGW_UCRT_ASM_CALL for __ms_fwprintf; this is provided as an
 363   * actual function in the ucrt import libraries. */
 364/* __attribute__((__format__ (ms_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
 365  int __cdecl __ms_wprintf(const wchar_t * __restrict__ _Format,...)
 366  __MINGW_UCRT_ASM_CALL(wprintf);
 367/* __attribute__((__format__ (ms_wprintf, 2, 0))) */__MINGW_ATTRIB_NONNULL(2)
 368  int __cdecl __ms_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList)
 369  __MINGW_UCRT_ASM_CALL(vfwprintf);
 370/*__attribute__((__format__ (ms_wprintf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
 371  int __cdecl __ms_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList)
 372  __MINGW_UCRT_ASM_CALL(vwprintf);
 373/* __attribute__((__format__ (ms_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3)
 374  int __cdecl __ms_swprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , ...)
 375  __MINGW_UCRT_ASM_CALL(swprintf);
 376/* __attribute__((__format__ (ms_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3)
 377  int __cdecl __ms_vswprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ ,va_list)
 378  __MINGW_UCRT_ASM_CALL(vswprintf);
 379/* __attribute__((__format__ (ms_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3)
 380  int __cdecl __ms_snwprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , ...)
 381  __MINGW_UCRT_ASM_CALL(snwprintf);
 382/* __attribute__((__format__ (ms_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3)
 383  int __cdecl __ms_vsnwprintf(wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list)
 384  __MINGW_UCRT_ASM_CALL(vsnwprintf);
 385
 386#ifdef _UCRT
 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
 393#if __USE_MINGW_ANSI_STDIO
 394
 395/*
 396 * User has expressed a preference for C99 conformance...
 397 */
 398/* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
 399int swscanf(const wchar_t *__source, const wchar_t *__format, ...)
 400__MINGW_ASM_CALL(__mingw_swscanf);
 401
 402/* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
 403int wscanf(const wchar_t *__format, ...)
 404__MINGW_ASM_CALL(__mingw_wscanf);
 405
 406/* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
 407int fwscanf(FILE *__stream, const wchar_t *__format, ...)
 408__MINGW_ASM_CALL(__mingw_fwscanf);
 409
 410#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
 411/* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
 412int vswscanf (const wchar_t *__source, const wchar_t *__format, __builtin_va_list __local_argv)
 413__MINGW_ASM_CALL(__mingw_vswscanf);
 414
 415/* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
 416int vwscanf(const wchar_t *__format,  __builtin_va_list __local_argv)
 417__MINGW_ASM_CALL(__mingw_vwscanf);
 418
 419/* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
 420int vfwscanf (FILE *__stream,  const wchar_t *__format, __builtin_va_list __local_argv)
 421__MINGW_ASM_CALL(__mingw_vfwscanf);
 422#endif /* __NO_ISOCEXT */
 423
 424
 425
 426/* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
 427int fwprintf (FILE *__stream, const wchar_t *__format, ...)
 428__MINGW_ASM_CALL(__mingw_fwprintf);
 429
 430/* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
 431int wprintf (const wchar_t *__format, ...)
 432__MINGW_ASM_CALL(__mingw_wprintf);
 433
 434/* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
 435int vfwprintf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
 436__MINGW_ASM_CALL(__mingw_vfwprintf);
 437
 438/* __attribute__((__format__ (gnu_wprintf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
 439int vwprintf (const wchar_t *__format, __builtin_va_list __local_argv)
 440__MINGW_ASM_CALL(__mingw_vwprintf);
 441
 442/* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3)
 443int 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)
 447int 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
 452/* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3)
 453int snwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, ...)
 454__MINGW_ASM_CALL(__mingw_snwprintf);
 455
 456/* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3)
 457int vsnwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builtin_va_list __local_argv)
 458__MINGW_ASM_CALL(__mingw_vsnwprintf);
 459
 460#endif /* __NO_ISOCEXT */
 461
 462#else /* !__USE_MINGW_ANSI_STDIO */
 463
 464#ifdef _UCRT
 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,...);
 471  __MINGW_ATTRIB_NONNULL(2)
 472  int vfwscanf (FILE *__stream,  const wchar_t *__format, va_list __local_argv);
 473
 474  __MINGW_ATTRIB_NONNULL(2)
 475  int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, va_list __local_argv);
 476  __MINGW_ATTRIB_NONNULL(1)
 477  int vwscanf(const wchar_t *__format, va_list __local_argv);
 478
 479  int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
 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);
 483
 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);
 486#else
 487
 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 */
 492  __MINGW_ATTRIB_NONNULL(2)
 493  int vfwscanf (FILE *__stream,  const wchar_t *__format, __builtin_va_list __local_argv);
 494
 495  __MINGW_ATTRIB_NONNULL(2)
 496   int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, __builtin_va_list __local_argv);
 497
 498  __MINGW_ATTRIB_NONNULL(1)
 499  int vwscanf(const wchar_t *__format,  __builtin_va_list __local_argv);
 500#endif /* __NO_ISOCEXT */
 501
 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);
 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);
 509#endif /* _UCRT */
 510#endif /* __USE_MINGW_ANSI_STDIO */
 511
 512
 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
 523  wint_t __cdecl fgetwc(FILE *_File);
 524  _CRTIMP wint_t __cdecl _fgetwchar(void);
 525  wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
 526  _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
 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);
 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);
 534  _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 535  _CRTIMP int __cdecl _putws(const wchar_t *_Str);
 536
 537#ifdef _UCRT
 538  __mingw_ovr
 539  int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...)
 540  {
 541    __builtin_va_list __ap;
 542    int __ret;
 543    __builtin_va_start(__ap, _Format);
 544    __ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, _Format, NULL, __ap);
 545    __builtin_va_end(__ap);
 546    return __ret;
 547  }
 548  int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 549  __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN
 550  int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args)
 551  {
 552    return __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Dest, _Count, _Format, NULL, _Args);
 553  }
 554
 555#if __USE_MINGW_ANSI_STDIO == 0
 556  int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
 557  int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg);
 558#endif
 559
 560#else
 561  _CRTIMP int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...);
 562  _CRTIMP int __cdecl _swprintf_l(wchar_t * __restrict__ ,size_t _SizeInWords,const wchar_t * __restrict__ _Format,_locale_t _Locale,... ) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 563  _CRTIMP int __cdecl _swprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,...);
 564  _CRTIMP int __cdecl _vswprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,va_list _ArgList);
 565  _CRTIMP int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 566  _CRTIMP int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 567
 568#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
 569
 570#if __USE_MINGW_ANSI_STDIO == 0
 571#pragma push_macro("snwprintf")
 572#pragma push_macro("vsnwprintf")
 573# undef snwprintf
 574# undef vsnwprintf
 575  int __cdecl snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...) __MINGW_ASM_CALL(__ms_snwprintf);
 576  int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg) __MINGW_ASM_CALL(__ms_vsnwprintf);
 577#pragma pop_macro ("vsnwprintf")
 578#pragma pop_macro ("snwprintf")
 579#endif
 580
 581#endif /* _UCRT */
 582
 583#endif /* _WSTDIO_DEFINED */
 584
 585
 586#ifdef _UCRT
 587  __mingw_ovr int __cdecl _vfwscanf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 588  {
 589    return __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _File, _Format, _Locale, _ArgList);
 590  }
 591
 592  __mingw_ovr int __cdecl _vwscanf_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 593  {
 594    return _vfwscanf_l(stdin, _Format, _Locale, _ArgList);
 595  }
 596
 597  __mingw_ovr int __cdecl _fwscanf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, ...)
 598  {
 599    __builtin_va_list _ArgList;
 600    int _Ret;
 601    __builtin_va_start(_ArgList, _Locale);
 602    _Ret = _vfwscanf_l(_File, _Format, _Locale, _ArgList);
 603    __builtin_va_end(_ArgList);
 604    return _Ret;
 605  }
 606  __mingw_ovr int __cdecl _wscanf_l(const wchar_t *_Format, _locale_t _Locale, ...)
 607  {
 608    __builtin_va_list _ArgList;
 609    int _Ret;
 610    __builtin_va_start(_ArgList, _Locale);
 611    _Ret = _vfwscanf_l(stdin, _Format, _Locale, _ArgList);
 612    __builtin_va_end(_ArgList);
 613    return _Ret;
 614  }
 615
 616  __mingw_ovr int __cdecl _vsnwscanf_l(const wchar_t *_Src, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 617  {
 618    return __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Src, _MaxCount, _Format, _Locale, _ArgList);
 619  }
 620  __mingw_ovr int __cdecl _snwscanf_l(const wchar_t *_Src, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...)
 621  {
 622    __builtin_va_list _ArgList;
 623    int _Ret;
 624    __builtin_va_start(_ArgList, _Locale);
 625    _Ret = _vsnwscanf_l(_Src, _MaxCount, _Format, _Locale, _ArgList);
 626    __builtin_va_end(_ArgList);
 627    return _Ret;
 628  }
 629  __mingw_ovr int __cdecl _snwscanf(const wchar_t *_Src, size_t _MaxCount, const wchar_t *_Format, ...)
 630  {
 631    __builtin_va_list _ArgList;
 632    int _Ret;
 633    __builtin_va_start(_ArgList, _Format);
 634    _Ret = _vsnwscanf_l(_Src, _MaxCount, _Format, NULL, _ArgList);
 635    __builtin_va_end(_ArgList);
 636    return _Ret;
 637  }
 638
 639  __mingw_ovr int __cdecl _vswscanf_l(const wchar_t *_Src, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 640  {
 641    return __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Src, (size_t)-1, _Format, _Locale, _ArgList);
 642  }
 643  __mingw_ovr int __cdecl _swscanf_l(const wchar_t *_Src, const wchar_t *_Format, _locale_t _Locale, ...)
 644  {
 645    __builtin_va_list _ArgList;
 646    int _Ret;
 647    __builtin_va_start(_ArgList, _Locale);
 648    _Ret = _vswscanf_l(_Src, _Format, _Locale, _ArgList);
 649    __builtin_va_end(_ArgList);
 650    return _Ret;
 651  }
 652
 653  __mingw_ovr int __cdecl _vfwprintf_p_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 654  {
 655    return __stdio_common_vfwprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _File, _Format, _Locale, _ArgList);
 656  }
 657  __mingw_ovr int __cdecl _vwprintf_p_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 658  {
 659    return _vfwprintf_p_l(stdout, _Format, _Locale, _ArgList);
 660  }
 661  __mingw_ovr int __cdecl _vfwprintf_p(FILE *_File, const wchar_t *_Format, va_list _ArgList)
 662  {
 663    return _vfwprintf_p_l(_File, _Format, NULL, _ArgList);
 664  }
 665  __mingw_ovr int __cdecl _vwprintf_p(const wchar_t *_Format, va_list _ArgList)
 666  {
 667    return _vfwprintf_p_l(stdout, _Format, NULL, _ArgList);
 668  }
 669  __mingw_ovr int __cdecl _fwprintf_p_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, ...)
 670  {
 671    __builtin_va_list _ArgList;
 672    int _Ret;
 673    __builtin_va_start(_ArgList, _Locale);
 674    _Ret = _vfwprintf_p_l(_File, _Format, _Locale, _ArgList);
 675    __builtin_va_end(_ArgList);
 676    return _Ret;
 677  }
 678  __mingw_ovr int __cdecl _wprintf_p_l(const wchar_t *_Format, _locale_t _Locale, ...)
 679  {
 680    __builtin_va_list _ArgList;
 681    int _Ret;
 682    __builtin_va_start(_ArgList, _Locale);
 683    _Ret = _vfwprintf_p_l(stdout, _Format, _Locale, _ArgList);
 684    __builtin_va_end(_ArgList);
 685    return _Ret;
 686  }
 687  __mingw_ovr int __cdecl _fwprintf_p(FILE *_File, const wchar_t *_Format, ...)
 688  {
 689    __builtin_va_list _ArgList;
 690    int _Ret;
 691    __builtin_va_start(_ArgList, _Format);
 692    _Ret = _vfwprintf_p_l(_File, _Format, NULL, _ArgList);
 693    __builtin_va_end(_ArgList);
 694    return _Ret;
 695  }
 696  __mingw_ovr int __cdecl _wprintf_p(const wchar_t *_Format, ...)
 697  {
 698    __builtin_va_list _ArgList;
 699    int _Ret;
 700    __builtin_va_start(_ArgList, _Format);
 701    _Ret = _vfwprintf_p_l(stdout, _Format, NULL, _ArgList);
 702    __builtin_va_end(_ArgList);
 703    return _Ret;
 704  }
 705
 706  __mingw_ovr int __cdecl _vfwprintf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 707  {
 708    return __stdio_common_vfwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _File, _Format, _Locale, _ArgList);
 709  }
 710  __mingw_ovr int __cdecl _vwprintf_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 711  {
 712    return _vfwprintf_l(stdout, _Format, _Locale, _ArgList);
 713  }
 714  __mingw_ovr int __cdecl _fwprintf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, ...)
 715  {
 716    __builtin_va_list _ArgList;
 717    int _Ret;
 718    __builtin_va_start(_ArgList, _Locale);
 719    _Ret = _vfwprintf_l(_File, _Format, _Locale, _ArgList);
 720    __builtin_va_end(_ArgList);
 721    return _Ret;
 722  }
 723  __mingw_ovr int __cdecl _wprintf_l(const wchar_t *_Format, _locale_t _Locale, ...)
 724  {
 725    __builtin_va_list _ArgList;
 726    int _Ret;
 727    __builtin_va_start(_ArgList, _Locale);
 728    _Ret = _vfwprintf_l(stdout, _Format, _Locale, _ArgList);
 729    __builtin_va_end(_ArgList);
 730    return _Ret;
 731  }
 732
 733  __mingw_ovr int __cdecl _vswprintf_p_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 734  {
 735    return __stdio_common_vswprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _DstBuf, _MaxCount, _Format, _Locale, _ArgList);
 736  }
 737  __mingw_ovr int __cdecl _vswprintf_p(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, va_list _ArgList)
 738  {
 739    return _vswprintf_p_l(_DstBuf, _MaxCount, _Format, NULL, _ArgList);
 740  }
 741  __mingw_ovr int __cdecl _swprintf_p_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...)
 742  {
 743    __builtin_va_list _ArgList;
 744    int _Ret;
 745    __builtin_va_start(_ArgList, _Locale);
 746    _Ret = _vswprintf_p_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList);
 747    __builtin_va_end(_ArgList);
 748    return _Ret;
 749  }
 750  __mingw_ovr int __cdecl _swprintf_p(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, ...)
 751  {
 752    __builtin_va_list _ArgList;
 753    int _Ret;
 754    __builtin_va_start(_ArgList, _Format);
 755    _Ret = _vswprintf_p_l(_DstBuf, _MaxCount, _Format, NULL, _ArgList);
 756    __builtin_va_end(_ArgList);
 757    return _Ret;
 758  }
 759
 760  __mingw_ovr int __cdecl _vsnwprintf_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 761  {
 762    return __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _DstBuf, _MaxCount, _Format, _Locale, _ArgList);
 763  }
 764  __mingw_ovr int __cdecl _snwprintf_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...)
 765  {
 766    __builtin_va_list _ArgList;
 767    int _Ret;
 768    __builtin_va_start(_ArgList, _Locale);
 769    _Ret = _vsnwprintf_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList);
 770    __builtin_va_end(_ArgList);
 771    return _Ret;
 772  }
 773
 774  __mingw_ovr int __cdecl _vscwprintf_p_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 775  {
 776    return __stdio_common_vswprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, _Format, _Locale, _ArgList);
 777  }
 778  __mingw_ovr int __cdecl _vscwprintf_p(const wchar_t *_Format, va_list _ArgList)
 779  {
 780    return _vscwprintf_p_l(_Format, NULL, _ArgList);
 781  }
 782  __mingw_ovr int __cdecl _scwprintf_p_l(const wchar_t *_Format, _locale_t _Locale, ...)
 783  {
 784    __builtin_va_list _ArgList;
 785    int _Ret;
 786    __builtin_va_start(_ArgList, _Locale);
 787    _Ret = _vscwprintf_p_l(_Format, _Locale, _ArgList);
 788    __builtin_va_end(_ArgList);
 789    return _Ret;
 790  }
 791  __mingw_ovr int __cdecl _scwprintf_p(const wchar_t *_Format, ...)
 792  {
 793    __builtin_va_list _ArgList;
 794    int _Ret;
 795    __builtin_va_start(_ArgList, _Format);
 796    _Ret = _vscwprintf_p_l(_Format, NULL, _ArgList);
 797    __builtin_va_end(_ArgList);
 798    return _Ret;
 799  }
 800
 801  __mingw_ovr int __cdecl _vscwprintf_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 802  {
 803    return __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, _Format, _Locale, _ArgList);
 804  }
 805  __mingw_ovr int __cdecl _vscwprintf(const wchar_t *_Format, va_list _ArgList)
 806  {
 807    return _vscwprintf_l(_Format, NULL, _ArgList);
 808  }
 809  __mingw_ovr int __cdecl _scwprintf_l(const wchar_t *_Format, _locale_t _Locale, ...)
 810  {
 811    __builtin_va_list _ArgList;
 812    int _Ret;
 813    __builtin_va_start(_ArgList, _Locale);
 814    _Ret = _vscwprintf_l(_Format, _Locale, _ArgList);
 815    __builtin_va_end(_ArgList);
 816    return _Ret;
 817  }
 818
 819  __mingw_ovr int __cdecl _vswprintf_c_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 820  {
 821    return __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _DstBuf, _MaxCount, _Format, _Locale, _ArgList);
 822  }
 823  __mingw_ovr int __cdecl __vswprintf_l(wchar_t *_DstBuf, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 824  {
 825    return _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, _Locale, _ArgList);
 826  }
 827  __mingw_ovr int __cdecl _vswprintf_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
 828  {
 829    return _vswprintf_c_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList);
 830  }
 831  __mingw_ovr int __cdecl _vswprintf(wchar_t *_DstBuf, const wchar_t *_Format, va_list _ArgList)
 832  {
 833    return _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, NULL, _ArgList);
 834  }
 835  __mingw_ovr int __cdecl _swprintf_c_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...)
 836  {
 837    __builtin_va_list _ArgList;
 838    int _Ret;
 839    __builtin_va_start(_ArgList, _Locale);
 840    _Ret = _vswprintf_c_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList);
 841    __builtin_va_end(_ArgList);
 842    return _Ret;
 843  }
 844  __mingw_ovr int __cdecl __swprintf_l(wchar_t *_DstBuf, const wchar_t *_Format, _locale_t _Locale, ...)
 845  {
 846    __builtin_va_list _ArgList;
 847    int _Ret;
 848    __builtin_va_start(_ArgList, _Locale);
 849    _Ret = _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, _Locale, _ArgList);
 850    __builtin_va_end(_ArgList);
 851    return _Ret;
 852  }
 853  __mingw_ovr int __cdecl _swprintf(wchar_t *_DstBuf, const wchar_t *_Format, ...)
 854  {
 855    __builtin_va_list _ArgList;
 856    int _Ret;
 857    __builtin_va_start(_ArgList, _Format);
 858    _Ret = _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, NULL, _ArgList);
 859    __builtin_va_end(_ArgList);
 860    return _Ret;
 861  }
 862#else /* _UCRT */
 863  _CRTIMP int __cdecl _fwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
 864  _CRTIMP int __cdecl _wprintf_p(const wchar_t * __restrict__ _Format,...);
 865  _CRTIMP int __cdecl _vfwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
 866  _CRTIMP int __cdecl _vwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList);
 867  _CRTIMP int __cdecl _swprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,...);
 868  _SECIMP int __cdecl _vswprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,va_list _ArgList);
 869  _CRTIMP int __cdecl _scwprintf_p(const wchar_t * __restrict__ _Format,...);
 870  _SECIMP int __cdecl _vscwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList);
 871  _CRTIMP int __cdecl _wprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 872  _CRTIMP int __cdecl _wprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 873  _CRTIMP int __cdecl _vwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
 874  _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
 875  _CRTIMP int __cdecl _fwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 876  _CRTIMP int __cdecl _fwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 877  _CRTIMP int __cdecl _vfwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
 878  _CRTIMP int __cdecl _vfwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
 879  _CRTIMP int __cdecl _swprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 880  _CRTIMP int __cdecl _swprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 881  _CRTIMP int __cdecl _vswprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
 882  _CRTIMP int __cdecl _vswprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
 883  _CRTIMP int __cdecl _scwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 884  _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 885  _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
 886  _CRTIMP int __cdecl _snwprintf_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 887  _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;
 888  _CRTIMP int __cdecl _swprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,...);
 889  _CRTIMP int __cdecl _vswprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,va_list _Args);
 890  _CRTIMP int __cdecl __swprintf_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,_locale_t _Plocinfo,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 891  _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;
 892  _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;
 893#endif /* !_UCRT */
 894
 895#ifndef RC_INVOKED
 896#include <swprintf.inl>
 897#endif
 898
 899#ifdef _CRT_NON_CONFORMING_SWPRINTFS
 900#ifndef __cplusplus
 901#define _swprintf_l __swprintf_l
 902#define _vswprintf_l __vswprintf_l
 903#endif
 904#endif
 905
 906#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
 907#pragma push_macro("_wtempnam")
 908#undef _wtempnam
 909#endif
 910  _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix);
 911#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
 912#pragma pop_macro("_wtempnam")
 913#endif
 914
 915#ifndef _UCRT
 916  _CRTIMP int __cdecl _vscwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
 917  _CRTIMP int __cdecl _vscwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
 918  _CRTIMP int __cdecl _fwscanf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 919  _CRTIMP int __cdecl _swscanf_l(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 920  _CRTIMP int __cdecl _snwscanf(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,...);
 921  _CRTIMP int __cdecl _snwscanf_l(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
 922  _CRTIMP int __cdecl _wscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 923#endif /* !_UCRT */
 924  _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode);
 925  _CRTIMP FILE *__cdecl _wfopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 926  _CRTIMP FILE *__cdecl _wfreopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode,FILE * __restrict__ _OldFile) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 927
 928#ifndef _CRT_WPERROR_DEFINED
 929#define _CRT_WPERROR_DEFINED
 930  _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
 931#endif
 932  _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode);
 933#if !defined(NO_OLDNAMES) && !defined(wpopen)
 934#define wpopen	_wpopen
 935#endif
 936  _CRTIMP int __cdecl _wremove(const wchar_t *_Filename);
 937  _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer);
 938#if __MSVCRT_VERSION__ >= 0x800
 939  _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File);
 940  _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File);
 941  _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File);
 942#endif
 943
 944#undef _CRT_GETPUTWCHAR_NOINLINE
 945
 946#if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) || defined (__CRT__NO_INLINE)
 947#define getwchar() fgetwc(stdin)
 948#define putwchar(_c) fputwc((_c),stdout)
 949#else
 950  __CRT_INLINE wint_t __cdecl getwchar() {return (fgetwc(stdin)); }
 951  __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) {return (fputwc(_C,stdout)); }
 952#endif
 953
 954#define getwc(_stm) fgetwc(_stm)
 955#define putwc(_c,_stm) fputwc(_c,_stm)
 956#if __MSVCRT_VERSION__ >= 0x800
 957#define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm)
 958#define _getwc_nolock(_c) _fgetwc_nolock(_c)
 959#endif
 960#endif
 961
 962#ifndef _WSTDLIB_DEFINED
 963#define _WSTDLIB_DEFINED
 964
 965  _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 966  _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 967  _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 968  _CRTIMP double __cdecl _wcstod_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,_locale_t _Locale);
 969
 970  double __cdecl __mingw_wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr);
 971  float __cdecl __mingw_wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr);
 972  long double __cdecl __mingw_wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__);
 973
 974#if defined(__USE_MINGW_STRTOX) && !defined(_UCRT)
 975  __mingw_ovr
 976  double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){
 977    return __mingw_wcstod(_Str,_EndPtr);
 978  }
 979  __mingw_ovr
 980  float __cdecl wcstof(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){
 981    return __mingw_wcstof(_Str,_EndPtr);
 982  }
 983  /* wcstold is already a mingw implementation */
 984#else
 985  double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr);
 986  float __cdecl wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr);
 987#endif /* !defined(__USE_MINGW_STRTOX) || defined(_UCRT) */
 988#if !defined __NO_ISOCEXT /* in libmingwex.a */
 989  long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
 990#endif /* __NO_ISOCEXT */
 991  long __cdecl wcstol(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix);
 992  _CRTIMP long __cdecl _wcstol_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale);
 993  unsigned long __cdecl wcstoul(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix);
 994  _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale);
 995  _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 996#ifndef _CRT_WSYSTEM_DEFINED
 997#define _CRT_WSYSTEM_DEFINED
 998  _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
 999#endif
1000  _CRTIMP double __cdecl _wtof(const wchar_t *_Str);
1001  _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale);
1002  _CRTIMP int __cdecl _wtoi(const wchar_t *_Str);
1003  _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale);
1004  _CRTIMP long __cdecl _wtol(const wchar_t *_Str);
1005  _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
1006
1007  __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1008  __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
1009  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
1010  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale);
1011  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
1012  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
1013  __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
1014  __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
1015#endif
1016
1017#ifndef _POSIX_
1018#ifndef _WSTDLIBP_DEFINED
1019#define _WSTDLIBP_DEFINED
1020#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
1021#pragma push_macro("_wfullpath")
1022#undef _wfullpath
1023#endif
1024  _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords);
1025#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
1026#pragma pop_macro("_wfullpath")
1027#endif
1028  _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext);
1029#ifndef _CRT_WPERROR_DEFINED
1030#define _CRT_WPERROR_DEFINED
1031  _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
1032#endif
1033  _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString);
1034  _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1035  _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;
1036#endif
1037#endif
1038
1039#ifndef _WSTRING_DEFINED
1040#define _WSTRING_DEFINED
1041#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
1042#pragma push_macro("_wcsdup")
1043#undef _wcsdup
1044#endif
1045  _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str);
1046#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
1047#pragma pop_macro("_wcsdup")
1048#endif
1049  wchar_t *__cdecl wcscat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1050  _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
1051  int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2);
1052  wchar_t *__cdecl wcscpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1053  size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control);
1054  size_t __cdecl wcslen(const wchar_t *_Str);
1055  size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount);
1056  wchar_t *__cdecl wcsncat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1057  int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
1058  wchar_t *__cdecl wcsncpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1059  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;
1060  _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control);
1061  _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
1062  size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control);
1063  _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr);
1064  wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim,wchar_t ** __restrict__ _Ptr) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1065  wchar_t *__cdecl _wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1066#if defined(_CRT_NON_CONFORMING_WCSTOK) && !defined(__cplusplus)
1067  #define wcstok _wcstok
1068#endif
1069#if !defined(_CRT_NO_INLINE_DEPRECATED_WCSTOK) && defined(__cplusplus)
1070  extern "C++" inline wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) { return _wcstok(_Str, _Delim); }
1071#endif
1072  _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1073  _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1074  _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
1075  _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
1076  _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
1077  _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
1078  _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1079  _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str);
1080  _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1081  _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1082  _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1083  _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1084  _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1085  size_t __cdecl wcsxfrm(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount);
1086  _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount,_locale_t _Locale);
1087  int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2);
1088  _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
1089  _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
1090  _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
1091  _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
1092  _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
1093  _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
1094  _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
1095
1096#ifndef	NO_OLDNAMES
1097#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
1098#pragma push_macro("wcsdup")
1099#undef wcsdup
1100#endif
1101  wchar_t *__cdecl wcsdup(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1102#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
1103#pragma pop_macro("wcsdup")
1104#endif
1105#define wcswcs wcsstr
1106  int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1107  int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1108  wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1109  wchar_t *__cdecl wcsrev(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1110  wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1111  wchar_t *__cdecl wcslwr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1112  wchar_t *__cdecl wcsupr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1113  int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1114#endif
1115#endif
1116
1117#ifndef _TM_DEFINED
1118#define _TM_DEFINED
1119  struct tm {
1120    int tm_sec;
1121    int tm_min;
1122    int tm_hour;
1123    int tm_mday;
1124    int tm_mon;
1125    int tm_year;
1126    int tm_wday;
1127    int tm_yday;
1128    int tm_isdst;
1129  };
1130#endif
1131
1132#ifndef _WTIME_DEFINED
1133#define _WTIME_DEFINED
1134
1135  _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm);
1136  _SECIMP errno_t __cdecl _wasctime_s (wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm);
1137  wchar_t *__cdecl _wctime32(const __time32_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1138  _SECIMP errno_t __cdecl _wctime32_s (wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time);
1139  size_t __cdecl wcsftime(wchar_t * __restrict__ _Buf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,const struct tm * __restrict__ _Tm);
1140  _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);
1141  _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1142  _SECIMP errno_t __cdecl _wstrdate_s (wchar_t *_Buf,size_t _SizeInWords);
1143  _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1144  _SECIMP errno_t __cdecl _wstrtime_s (wchar_t *_Buf,size_t _SizeInWords);
1145  _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1146  _SECIMP errno_t __cdecl _wctime64_s (wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time);
1147
1148#if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
1149#define _INC_WTIME_INL
1150  wchar_t *__cdecl _wctime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1151#ifndef __CRT__NO_INLINE
1152#ifndef _USE_32BIT_TIME_T
1153  __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); }
1154#else
1155  __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); }
1156#endif
1157#endif /* __CRT__NO_INLINE */
1158#endif
1159
1160#if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL)
1161#define _INC_WTIME_S_INL
1162  errno_t __cdecl _wctime_s(wchar_t *, size_t, const time_t *);
1163#ifndef __CRT__NO_INLINE
1164#ifndef _USE_32BIT_TIME_T
1165  __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s (_Buffer,_SizeInWords,_Time); }
1166#else
1167  __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s (_Buffer,_SizeInWords,_Time); }
1168#endif /* _USE_32BIT_TIME_T */
1169#endif  /* __CRT__NO_INLINE */
1170#endif /* !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) */
1171
1172#endif
1173
1174#if defined(_UCRT) || defined(__LARGE_MBSTATE_T)
1175  typedef struct _Mbstatet {
1176    unsigned long _Wchar;
1177    unsigned short _Byte, _State;
1178  } _Mbstatet;
1179  typedef _Mbstatet mbstate_t;
1180#else
1181  typedef int mbstate_t;
1182#endif
1183  typedef wchar_t _Wint_t;
1184
1185  wint_t __cdecl btowc(int);
1186  size_t __cdecl mbrlen(const char * __restrict__ _Ch,size_t _SizeInBytes,mbstate_t * __restrict__ _State);
1187  size_t __cdecl mbrtowc(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SizeInBytes,mbstate_t * __restrict__ _State);
1188  size_t __cdecl mbsrtowcs(wchar_t * __restrict__ _Dest,const char ** __restrict__ _PSrc,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1189  size_t __cdecl wcrtomb(char * __restrict__ _Dest,wchar_t _Source,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1190  size_t __cdecl wcsrtombs(char * __restrict__ _Dest,const wchar_t ** __restrict__ _PSource,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1191  int __cdecl wctob(wint_t _WCh);
1192
1193#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */
1194  wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n);
1195  _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n);
1196  int __cdecl wmemcmp(const wchar_t *s1, const wchar_t *s2,size_t n);
1197  wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ s1,const wchar_t * __restrict__ s2,size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1198  wchar_t * __cdecl wmempcpy (wchar_t *_Dst, const wchar_t *_Src, size_t _Size);
1199  wchar_t *__cdecl wmemmove(wchar_t *s1, const wchar_t *s2, size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1200  int __cdecl fwide(FILE *stream,int mode);
1201#if defined(_UCRT) || defined(__LARGE_MBSTATE_T)
1202  /* With UCRT, mbsinit is only available as inline. */
1203  __mingw_ovr int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || _P->_Wchar == 0); }
1204#else
1205  int __cdecl mbsinit(const mbstate_t *ps);
1206#endif
1207  __MINGW_EXTENSION long long __cdecl wcstoll(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base);
1208  __MINGW_EXTENSION unsigned long long __cdecl wcstoull(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base);
1209#endif /* __NO_ISOCEXT */
1210
1211  void *__cdecl memmove(void *_Dst,const void *_Src,size_t _MaxCount);
1212  void *__cdecl memcpy(void * __restrict__ _Dst,const void * __restrict__ _Src,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1213#ifndef __CRT__NO_INLINE
1214  __CRT_INLINE int __cdecl fwide(FILE *_F,int _M) { (void)_F; return (_M); }
1215#if !defined(_UCRT) && !defined(__LARGE_MBSTATE_T)
1216  __CRT_INLINE int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || *_P==0); }
1217#endif
1218  __CRT_INLINE _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *_S,wchar_t _C,size_t _N) {
1219    if (_S) {
1220      for ( ; 0 < _N; ++_S, --_N)
1221	if (*_S == _C)
1222	  return (_CONST_RETURN wchar_t *)(_S);
1223    }
1224    return (_CONST_RETURN wchar_t *) NULL;
1225  }
1226  __CRT_INLINE int __cdecl wmemcmp(const wchar_t *_S1,const wchar_t *_S2,size_t _N) {
1227    if (_N == 0 || _S1 == _S2)
1228      return 0;	/* even for NULL pointers.  */
1229    if ((_S1 && !(_S2)) || (_S2 && !(_S1)))
1230      return !(_S2) ? 1 : -1; /* robust.  */
1231    for ( ; 0 < _N; ++_S1, ++_S2, --_N)
1232      if (*_S1 != *_S2)
1233	return (*_S1 < *_S2 ? -1 : +1);
1234    return 0;
1235  }
1236  __CRT_INLINE wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ _S1,const wchar_t * __restrict__ _S2,size_t _N)
1237  {
1238    return (wchar_t *) memcpy (_S1,_S2,_N*sizeof(wchar_t));
1239  }
1240  __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)); }
1241  __CRT_INLINE wchar_t *__cdecl wmemset(wchar_t *_S,wchar_t _C,size_t _N) {
1242    wchar_t *_Su = _S;
1243    for (;0<_N;++_Su,--_N) {
1244      *_Su = _C;
1245    }
1246    return (_S);
1247  }
1248#endif /* !__CRT__NO_INLINE */
1249
1250#ifndef __MINGW_MBWC_CONVERT_DEFINED
1251#define __MINGW_MBWC_CONVERT_DEFINED
1252
1253/**
1254 * __mingw_str_wide_utf8
1255 * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent.
1256 * Caller is supposed to free allocated buffer with __mingw_str_free().
1257 * @param[in] wptr Pointer to wide string.
1258 * @param[out] mbptr Pointer to multibyte string.
1259 * @param[out] buflen Optional parameter for length of allocated buffer.
1260 * @return bytes written by WideCharToMultiByte conversion, 0 for failure.
1261 *
1262 * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx
1263 */
1264int __cdecl __mingw_str_wide_utf8 (const wchar_t * const wptr, char **mbptr, size_t * buflen);
1265
1266/**
1267 * __mingw_str_utf8_wide
1268 * Converts a null terminated UTF-8 string to a UCS-2 equivalent.
1269 * Caller is supposed to free allocated buffer with __mingw_str_free().
1270 * @param[out] mbptr Pointer to multibyte string.
1271 * @param[in] wptr Pointer to wide string.
1272 * @param[out] buflen Optional parameter for length of allocated buffer.
1273 * @return bytes written by WideCharToMultiByte conversion, 0 for failure.
1274 *
1275 * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx
1276 */
1277
1278int __cdecl __mingw_str_utf8_wide (const char *const mbptr, wchar_t ** wptr, size_t * buflen);
1279
1280/**
1281 * __mingw_str_free
1282 * Frees buffer create by __mingw_str_wide_utf8 and __mingw_str_utf8_wide.
1283 * @param[in] ptr memory block to free.
1284 *
1285 */
1286
1287void __cdecl __mingw_str_free(void *ptr);
1288
1289#endif /* __MINGW_MBWC_CONVERT_DEFINED */
1290
1291#ifdef __cplusplus
1292}
1293#endif
1294
1295#pragma pack(pop)
1296
1297#include <sec_api/wchar_s.h>
1298
1299#endif /* _INC_WCHAR */
1300