Sync trunk.
[reactos.git] / include / crt / wchar.h
index 3c3ef35..364b169 100644 (file)
-/*
- * wchar.h
+/**
  * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within the package.
- *
- * Defines of all functions for supporting wide characters. Actually it
- * just includes all those headers, which is not a good thing to do from a
- * processing time point of view, but it does mean that everything will be
- * in sync.
- *
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
  */
+#ifndef _INC_WCHAR
+#define _INC_WCHAR
 
-#ifndef        _WCHAR_H_
-#define        _WCHAR_H_
+#include <crtdefs.h>
 
-/* All the headers include this file. */
-#include <_mingw.h>
-
-#ifndef RC_INVOKED
-
-#define __need_size_t
-#define __need_wint_t
-#define __need_wchar_t
-#define __need_NULL
-#include <stddef.h>
-
-#ifndef __VALIST
-#if defined __GNUC__ && __GNUC__ >= 3
 #define __need___va_list
 #include <stdarg.h>
-#define __VALIST __builtin_va_list
-#else
-#define __VALIST char*
-#endif
-#endif
 
-#endif /* Not RC_INVOKED */
+#pragma pack(push,_CRT_PACKING)
 
-/*
- * MSDN says that isw* char classifications are in wchar.h and wctype.h.
- * Although the wctype names are ANSI, their exposure in this header is
- * not.
- */
-#include <wctype.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-#ifndef        __STRICT_ANSI__
-/* This is necessary to support the the non-ANSI wchar declarations
-   here. */
-#include <sys/types.h>
-#endif /* __STRICT_ANSI__ */
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4820)
+#endif
 
-#define WCHAR_MIN      0
-#define WCHAR_MAX      0xffff
+#ifndef WCHAR_MIN
+#define WCHAR_MIN 0
+#endif
+#ifndef WCHAR_MAX
+#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
+#endif
 
 #ifndef WEOF
-#define        WEOF    (wchar_t)(0xFFFF)
+#define WEOF (wint_t)(0xFFFF)
 #endif
 
-#ifndef RC_INVOKED
-
-#ifdef __cplusplus 
-extern "C" {
+#ifndef _FILE_DEFINED
+  struct _iobuf {
+    char *_ptr;
+    int _cnt;
+    char *_base;
+    int _flag;
+    int _file;
+    int _charbuf;
+    int _bufsiz;
+    char *_tmpfname;
+  };
+  typedef struct _iobuf FILE;
+#define _FILE_DEFINED
 #endif
 
-#ifndef _FILE_DEFINED  /* Also in stdio.h */
-#define        _FILE_DEFINED
-typedef struct _iobuf
-{
-       char*   _ptr;
-       int     _cnt;
-       char*   _base;
-       int     _flag;
-       int     _file;
-       int     _charbuf;
-       int     _bufsiz;
-       char*   _tmpfname;
-} FILE;
-#endif /* Not _FILE_DEFINED */
-
-#ifndef _TIME_T_DEFINED  /* Also in time.h */
-typedef long time_t;
-#define _TIME_T_DEFINED
-#endif
-
-#ifndef _TM_DEFINED /* Also in time.h */
-struct tm {
-        int tm_sec;     /* seconds after the minute - [0,59] */
-        int tm_min;     /* minutes after the hour - [0,59] */
-        int tm_hour;    /* hours since midnight - [0,23] */
-        int tm_mday;    /* day of the month - [1,31] */
-        int tm_mon;     /* months since January - [0,11] */
-        int tm_year;    /* years since 1900 */
-        int tm_wday;    /* days since Sunday - [0,6] */
-        int tm_yday;    /* days since January 1 - [0,365] */
-        int tm_isdst;   /* daylight savings time flag */
-        };
-#define _TM_DEFINED
+#ifndef _STDIO_DEFINED
+  _CRTIMP FILE *__cdecl __iob_func(void);
+  _CRTDATA(extern FILE _iob[];)
+#ifdef _M_CEE_PURE
+#define _iob __iob_func()
+#endif
 #endif
 
-#ifndef _WSTDIO_DEFINED
-/*  Also in stdio.h - keep in sync */
-_CRTIMP int __cdecl __MINGW_NOTHROW    fwprintf (FILE*, const wchar_t*, ...);
-_CRTIMP int __cdecl __MINGW_NOTHROW    wprintf (const wchar_t*, ...);
-_CRTIMP int __cdecl __MINGW_NOTHROW    swprintf (wchar_t*, const wchar_t*, ...);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _snwprintf (wchar_t*, size_t, const wchar_t*, ...);
-_CRTIMP int __cdecl __MINGW_NOTHROW    vfwprintf (FILE*, const wchar_t*, __VALIST);
-_CRTIMP int __cdecl __MINGW_NOTHROW    vwprintf (const wchar_t*, __VALIST);
-_CRTIMP int __cdecl __MINGW_NOTHROW    vswprintf (wchar_t*, const wchar_t*, __VALIST);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST);
-_CRTIMP int __cdecl __MINGW_NOTHROW    fwscanf (FILE*, const wchar_t*, ...);
-_CRTIMP int __cdecl __MINGW_NOTHROW    wscanf (const wchar_t*, ...);
-_CRTIMP int __cdecl __MINGW_NOTHROW    swscanf (const wchar_t*, const wchar_t*, ...);
-_CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwc (FILE*);
-_CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwc (wchar_t, FILE*);
-_CRTIMP wint_t __cdecl __MINGW_NOTHROW ungetwc (wchar_t, FILE*);
-
-#ifdef __MSVCRT__ 
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    fputws (const wchar_t*, FILE*);
-_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*);
-_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwchar (void);
-_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*);
-_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t);
-#ifndef __STRICT_ANSI__
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _putws (const wchar_t*);
-_CRTIMP FILE* __cdecl __MINGW_NOTHROW  _wfdopen(int, wchar_t *);
-_CRTIMP FILE* __cdecl __MINGW_NOTHROW  _wfopen (const wchar_t*, const wchar_t*);
-_CRTIMP FILE* __cdecl __MINGW_NOTHROW  _wfreopen (const wchar_t*, const wchar_t*, FILE*);
-_CRTIMP FILE* __cdecl __MINGW_NOTHROW  _wfsopen (const wchar_t*, const wchar_t*, int);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtmpnam (wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtempnam (const wchar_t*, const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wrename (const wchar_t*, const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wremove (const wchar_t*);
-_CRTIMP void __cdecl __MINGW_NOTHROW   _wperror (const wchar_t*);
-_CRTIMP FILE* __cdecl __MINGW_NOTHROW  _wpopen (const wchar_t*, const wchar_t*);
-#endif  /* __STRICT_ANSI__ */
-#endif /* __MSVCRT__ */
+#ifndef _STDSTREAM_DEFINED
+#define _STDSTREAM_DEFINED
+#define stdin (&_iob[0])
+#define stdout (&_iob[1])
+#define stderr (&_iob[1])
+#endif /* !_STDSTREAM_DEFINED */
 
-#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
-int __cdecl __MINGW_NOTHROW snwprintf (wchar_t* s, size_t n, const wchar_t*  format, ...);
-__CRT_INLINE int __cdecl __MINGW_NOTHROW
-vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg)
-  { return _vsnwprintf ( s, n, format, arg);}
-int __cdecl __MINGW_NOTHROW vwscanf (const wchar_t * __restrict__, __VALIST);
-int __cdecl __MINGW_NOTHROW vfwscanf (FILE * __restrict__,
-                      const wchar_t * __restrict__, __VALIST);
-int __cdecl __MINGW_NOTHROW vswscanf (const wchar_t * __restrict__,
-                      const wchar_t * __restrict__, __VALIST);
+#ifndef _FSIZE_T_DEFINED
+  typedef unsigned long _fsize_t;
+#define _FSIZE_T_DEFINED
 #endif
 
-#define _WSTDIO_DEFINED
-#endif /* _WSTDIO_DEFINED */
-#ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */
-_CRTIMP long __cdecl __MINGW_NOTHROW   wcstol (const wchar_t*, wchar_t**, int);
-_CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int);
-_CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**);
-#if !defined __NO_ISOCEXT /* in libmingwex.a */
-float __cdecl __MINGW_NOTHROW wcstof (const wchar_t * __restrict__, wchar_t ** __restrict__);
-long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
-#endif /* __NO_ISOCEXT */
-#ifdef __MSVCRT__ 
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wputenv(const wchar_t*);
-_CRTIMP void __cdecl __MINGW_NOTHROW   _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wsystem(const wchar_t*);
-_CRTIMP void __cdecl __MINGW_NOTHROW   _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
-_CRTIMP void __cdecl __MINGW_NOTHROW   _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t);
-#endif
-#define  _WSTDLIB_DEFINED
-#endif /* _WSTDLIB_DEFINED */
+#ifndef _WFINDDATA_T_DEFINED
+  struct _wfinddata_t {
+    unsigned attrib;
+    time_t time_create;
+    time_t time_access;
+    time_t time_write;
+    _fsize_t size;
+    wchar_t name[260];
+  };
+
+  struct _wfinddata32_t {
+    unsigned attrib;
+    __time32_t time_create;
+    __time32_t time_access;
+    __time32_t time_write;
+    _fsize_t size;
+    wchar_t name[260];
+  };
+
+#if _INTEGRAL_MAX_BITS >= 64
+  struct _wfinddatai64_t {
+    unsigned attrib;
+    time_t time_create;
+    time_t time_access;
+    time_t time_write;
+    __MINGW_EXTENSION __int64 size;
+    wchar_t name[260];
+  };
+
+  struct _wfinddata32i64_t {
+    unsigned attrib;
+    __time32_t time_create;
+    __time32_t time_access;
+    __time32_t time_write;
+    __MINGW_EXTENSION __int64 size;
+    wchar_t name[260];
+  };
+
+  struct _wfinddata64i32_t {
+    unsigned attrib;
+    __time64_t time_create;
+    __time64_t time_access;
+    __time64_t time_write;
+    _fsize_t size;
+    wchar_t name[260];
+  };
+
+  struct _wfinddata64_t {
+    unsigned attrib;
+    __time64_t time_create;
+    __time64_t time_access;
+    __time64_t time_write;
+    __MINGW_EXTENSION __int64 size;
+    wchar_t name[260];
+  };
+#endif
 
-#ifndef _WTIME_DEFINED
-#ifndef __STRICT_ANSI__
-#ifdef __MSVCRT__
-/* wide function prototypes, also declared in time.h */
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wasctime (const struct tm*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wctime (const time_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wstrdate (wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wstrtime (wchar_t*);
-#if __MSVCRT_VERSION__ >= 0x601
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wctime64 (const __time64_t*);
-#endif
-#endif /* __MSVCRT__ */
-#endif /* __STRICT_ANSI__ */
-_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
-#define _WTIME_DEFINED
-#endif /* _WTIME_DEFINED */ 
+#define _WFINDDATA_T_DEFINED
+#endif /* !_WFINDDATA_T_DEFINED */
 
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
 
-#ifndef _WSTRING_DEFINED
-/*
- * Unicode versions of the standard string calls.
- * Also in string.h.
- */
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscat (wchar_t*, const wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcschr (const wchar_t*, wchar_t);
-_CRTIMP int __cdecl __MINGW_NOTHROW    wcscmp (const wchar_t*, const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    wcscoll (const wchar_t*, const wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscpy (wchar_t*, const wchar_t*);
-_CRTIMP size_t __cdecl __MINGW_NOTHROW wcscspn (const wchar_t*, const wchar_t*);
-/* Note:  _wcserror requires __MSVCRT_VERSION__ >= 0x0700.  */
-_CRTIMP size_t __cdecl __MINGW_NOTHROW wcslen (const wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncat (wchar_t*, const wchar_t*, size_t);
-_CRTIMP int __cdecl __MINGW_NOTHROW    wcsncmp(const wchar_t*, const wchar_t*, size_t);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncpy(wchar_t*, const wchar_t*, size_t);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcspbrk(const wchar_t*, const wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrchr(const wchar_t*, wchar_t);
-_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsspn(const wchar_t*, const wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsstr(const wchar_t*, const wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcstok(wchar_t*, const wchar_t*);
-_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsxfrm(wchar_t*, const wchar_t*, size_t);
-
-#ifndef        __STRICT_ANSI__
-/*
- * Unicode versions of non-ANSI functions provided by CRTDLL.
- */
+#ifndef _CRT_CTYPEDATA_DEFINED
+# define _CRT_CTYPEDATA_DEFINED
+# ifndef _CTYPE_DISABLE_MACROS
+#  ifndef __PCTYPE_FUNC
+#   ifdef _DLL
+#    define __PCTYPE_FUNC __pctype_func()
+#   else
+#    define __PCTYPE_FUNC _pctype
+#   endif
+#  endif /* !__PCTYPE_FUNC */
+  _CRTIMP const unsigned short * __cdecl __pctype_func(void);
+#  ifndef _M_CEE_PURE
+  _CRTDATA(extern unsigned short *_pctype);
+#  else
+#   define _pctype (__pctype_func())
+#  endif /* !_M_CEE_PURE */
+# endif /* !_CTYPE_DISABLE_MACROS */
+#endif /* !_CRT_CTYPEDATA_DEFINED */
+
+#ifndef _CRT_WCTYPEDATA_DEFINED
+#define _CRT_WCTYPEDATA_DEFINED
+# ifndef _CTYPE_DISABLE_MACROS
+  _CRTDATA(extern unsigned short *_wctype);
+  _CRTIMP const wctype_t * __cdecl __pwctype_func(void);
+#  ifndef _M_CEE_PURE
+  _CRTDATA(extern const wctype_t *_pwctype);
+#  else
+#   define _pwctype (__pwctype_func())
+#  endif /* !_M_CEE_PURE */
+# endif /* !_CTYPE_DISABLE_MACROS */
+#endif /* !_CRT_WCTYPEDATA_DEFINED */
+
+#define _UPPER 0x1
+#define _LOWER 0x2
+#define _DIGIT 0x4
+#define _SPACE 0x8
+
+#define _PUNCT 0x10
+#define _CONTROL 0x20
+#define _BLANK 0x40
+#define _HEX 0x80
+
+#define _LEADBYTE 0x8000
+#define _ALPHA (0x0100|_UPPER|_LOWER)
+
+#ifndef _WCTYPE_DEFINED
+#define _WCTYPE_DEFINED
+  _CRTIMP int __cdecl iswalpha(wint_t _C);
+  _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswupper(wint_t _C);
+  _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswlower(wint_t _C);
+  _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswdigit(wint_t _C);
+  _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswxdigit(wint_t _C);
+  _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswspace(wint_t _C);
+  _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswpunct(wint_t _C);
+  _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswalnum(wint_t _C);
+  _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswprint(wint_t _C);
+  _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswgraph(wint_t _C);
+  _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswcntrl(wint_t _C);
+  _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswascii(wint_t _C);
+  _CRTIMP int __cdecl isleadbyte(int _C);
+  _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale);
+  _CRTIMP wint_t __cdecl towupper(wint_t _C);
+  _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP wint_t __cdecl towlower(wint_t _C);
+  _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl iswctype(wint_t _C,wctype_t _Type);
+  _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale);
+  _CRTIMP int __cdecl __iswcsymf(wint_t _C);
+  _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl __iswcsym(wint_t _C);
+  _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale);
+  _CRTIMP int __cdecl is_wctype(wint_t _C,wctype_t _Type);
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
+_CRTIMP int __cdecl iswblank(wint_t _C);
+#endif
+#endif
 
-/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
-#define                _wcscmpi        _wcsicmp
-
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsdup (const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wcsicmp (const wchar_t*, const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wcsicoll (const wchar_t*, const wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcslwr (wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsnset (wchar_t*, wchar_t, size_t);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsrev (wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsset (wchar_t*, wchar_t);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsupr (wchar_t*);
-
-#ifdef __MSVCRT__
-_CRTIMP int __cdecl __MINGW_NOTHROW  _wcsncoll(const wchar_t*, const wchar_t*, size_t);
-_CRTIMP int   __cdecl __MINGW_NOTHROW _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
-#if __MSVCRT_VERSION__ >= 0x0700
-_CRTIMP  wchar_t* __cdecl __MINGW_NOTHROW _wcserror(int);
-_CRTIMP  wchar_t* __cdecl __MINGW_NOTHROW __wcserror(const wchar_t*);
-#endif
-#endif
-
-#ifndef        _NO_OLDNAMES
-/* NOTE: There is no _wcscmpi, but this is for compatibility. */
-__CRT_INLINE int __cdecl __MINGW_NOTHROW
-wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2)
-  {return _wcsicmp (__ws1, __ws2);}
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsdup (const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    wcsicmp (const wchar_t*, const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    wcsicoll (const wchar_t*, const wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcslwr (wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    wcsnicmp (const wchar_t*, const wchar_t*, size_t);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsnset (wchar_t*, wchar_t, size_t);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrev (wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsset (wchar_t*, wchar_t);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsupr (wchar_t*);
-#endif /* Not _NO_OLDNAMES */
-
-#endif /* Not strict ANSI */
+#ifndef _WDIRECT_DEFINED
+#define _WDIRECT_DEFINED
+  _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords);
+  _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
+  wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
+  _CRTIMP int __cdecl _wchdir(const wchar_t *_Path);
+  _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path);
+  _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path);
+#endif
 
-#define _WSTRING_DEFINED
-#endif  /* _WSTRING_DEFINED */
-
-/* These are resolved by -lmingwex. Alternatively, they can be resolved by
-   adding -lmsvcp60 to your command line, which will give you the VC++
-   versions of these functions. If you want the latter and don't have
-   msvcp60.dll in your windows system directory, you can easily obtain
-   it with a search from your favorite search engine.  */
-#ifndef __STRICT_ANSI__
-typedef wchar_t _Wint_t;
-#endif
-
-typedef int mbstate_t;
-
-wint_t __cdecl __MINGW_NOTHROW btowc(int);
-size_t __cdecl __MINGW_NOTHROW mbrlen(const char * __restrict__, size_t,
-                     mbstate_t * __restrict__);
-size_t __cdecl __MINGW_NOTHROW mbrtowc(wchar_t * __restrict__, const char * __restrict__,
-                      size_t, mbstate_t * __restrict__);
-size_t __cdecl __MINGW_NOTHROW mbsrtowcs(wchar_t * __restrict__, const char ** __restrict__,
-                        size_t, mbstate_t * __restrict__);
-size_t __cdecl __MINGW_NOTHROW wcrtomb(char * __restrict__, wchar_t,
-                      mbstate_t * __restrict__);
-size_t __cdecl __MINGW_NOTHROW wcsrtombs(char * __restrict__, const wchar_t ** __restrict__,
-                        size_t, mbstate_t * __restrict__);
-int __cdecl __MINGW_NOTHROW wctob(wint_t);
+#ifndef _WIO_DEFINED
+#define _WIO_DEFINED
+  _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode);
+  _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode);
+  _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode);
+  _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData);
+  _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData);
+  _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename);
+  _CRTIMP int __cdecl _wrename(const wchar_t *_NewFilename,const wchar_t *_OldFilename);
+  _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName);
+#if _INTEGRAL_MAX_BITS >= 64
+  _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData);
+  _CRTIMP intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData);
+  _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData);
+  _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData);
+  _CRTIMP int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData);
+  _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData);
+#endif
+  _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag);
+#if !defined(__cplusplus) || !(defined(_X86_) && !defined(__x86_64))
+  _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...);
+  _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...);
+#else
+  extern "C++" _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,int _PermissionMode = 0);
+  extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0);
+#endif
+#endif /* !_WIO_DEFINED */
 
-#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */
-__CRT_INLINE int __cdecl __MINGW_NOTHROW fwide(FILE* __UNUSED_PARAM(stream),
-                              int __UNUSED_PARAM(mode))
-  {return -1;} /* limited to byte orientation */ 
-__CRT_INLINE int __cdecl __MINGW_NOTHROW mbsinit(const mbstate_t* __UNUSED_PARAM(ps))
-  {return 1;}
-wchar_t* __cdecl __MINGW_NOTHROW wmemset(wchar_t *, wchar_t, size_t);
-wchar_t* __cdecl __MINGW_NOTHROW wmemchr(const wchar_t*, wchar_t, size_t);
-int wmemcmp(const wchar_t*, const wchar_t *, size_t);
-wchar_t* __cdecl __MINGW_NOTHROW wmemcpy(wchar_t* __restrict__,
-                        const wchar_t* __restrict__,
-                        size_t);
-wchar_t* __cdecl __MINGW_NOTHROW wmemmove(wchar_t* s1, const wchar_t *, size_t);
-long long __cdecl __MINGW_NOTHROW wcstoll(const wchar_t * __restrict__,
-                         wchar_t** __restrict__, int);
-unsigned long long __cdecl __MINGW_NOTHROW wcstoull(const wchar_t * __restrict__,
-                           wchar_t ** __restrict__, int);
-#endif /* __NO_ISOCEXT */
+#ifndef _WLOCALE_DEFINED
+#define _WLOCALE_DEFINED
+  _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale);
+#endif
 
-#ifndef        __STRICT_ANSI__
-/* non-ANSI wide char functions from io.h, direct.h, sys/stat.h and locale.h.  */
+#ifndef _WPROCESS_DEFINED
+#define _WPROCESS_DEFINED
+  _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...);
+  _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...);
+  _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...);
+  _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...);
+  _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList);
+  _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
+  _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList);
+  _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
+  _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
+  _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
+  _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
+  _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
+  _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
+  _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
+  _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
+  _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
+#ifndef _CRT_WSYSTEM_DEFINED
+#define _CRT_WSYSTEM_DEFINED
+  _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
+#endif /* !_CRT_WSYSTEM_DEFINED */
+#endif /* !_WPROCESS_DEFINED */
+
+#ifndef _WCTYPE_INLINE_DEFINED
+#undef _CRT_WCTYPE_NOINLINE
+#if !defined(__cplusplus) || defined(_CRT_WCTYPE_NOINLINE)
+#define iswalpha(_c) (iswctype(_c,_ALPHA))
+#define iswupper(_c) (iswctype(_c,_UPPER))
+#define iswlower(_c) (iswctype(_c,_LOWER))
+#define iswdigit(_c) (iswctype(_c,_DIGIT))
+#define iswxdigit(_c) (iswctype(_c,_HEX))
+#define iswspace(_c) (iswctype(_c,_SPACE))
+#define iswpunct(_c) (iswctype(_c,_PUNCT))
+#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT))
+#define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
+#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
+#define iswcntrl(_c) (iswctype(_c,_CONTROL))
+#define iswascii(_c) ((unsigned)(_c) < 0x80)
+
+#define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p))
+#define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p))
+#define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p))
+#define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p))
+#define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p))
+#define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p))
+#define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p))
+#define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p))
+#define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p))
+#define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p))
+#define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p))
+#ifndef _CTYPE_DISABLE_MACROS
+#define isleadbyte(_c) (__PCTYPE_FUNC[(unsigned char)(_c)] & _LEADBYTE)
+#endif
+#endif
+#define _WCTYPE_INLINE_DEFINED
+#endif
 
-#ifndef        _FSIZE_T_DEFINED
-typedef        unsigned long   _fsize_t;
-#define _FSIZE_T_DEFINED
+#if !defined(_POSIX_) || defined(__GNUC__)
+#ifndef _INO_T_DEFINED
+#define _INO_T_DEFINED
+  typedef unsigned short _ino_t;
+#ifndef        NO_OLDNAMES
+  typedef unsigned short ino_t;
+#endif
 #endif
 
-#ifndef _WFINDDATA_T_DEFINED
-struct _wfinddata_t {
-       unsigned        attrib;
-       time_t          time_create;    /* -1 for FAT file systems */
-       time_t          time_access;    /* -1 for FAT file systems */
-       time_t          time_write;
-       _fsize_t        size;
-       wchar_t         name[260];      /* may include spaces. */
-};
-struct _wfinddatai64_t {
-       unsigned    attrib;
-       time_t      time_create;
-       time_t      time_access;
-       time_t      time_write;
-       __int64     size;
-       wchar_t     name[260];
-};
-struct __wfinddata64_t {
-        unsigned    attrib;
-        __time64_t  time_create;    
-        __time64_t  time_access;
-        __time64_t  time_write;
-        _fsize_t    size;
-        wchar_t     name[260];
-};
-#define _WFINDDATA_T_DEFINED
+#ifndef _DEV_T_DEFINED
+#define _DEV_T_DEFINED
+  typedef unsigned int _dev_t;
+#ifndef        NO_OLDNAMES
+  typedef unsigned int dev_t;
+#endif
 #endif
 
-/* Wide character versions. Also defined in io.h. */
-/* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also
-   applies to other wide character versions? */
-#if !defined (_WIO_DEFINED)
-#if defined (__MSVCRT__)
-#include <stdint.h>  /* For intptr_t.  */
-_CRTIMP int __cdecl __MINGW_NOTHROW    _waccess (const wchar_t*, int);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wchmod (const wchar_t*, int);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wcreat (const wchar_t*, int);
-_CRTIMP long __cdecl __MINGW_NOTHROW   _wfindfirst (const wchar_t*, struct _wfinddata_t *);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wfindnext (long, struct _wfinddata_t *);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wunlink (const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wopen (const wchar_t*, int, ...);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wsopen (const wchar_t*, int, int, ...);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wmktemp (wchar_t*);
-_CRTIMP long __cdecl __MINGW_NOTHROW   _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wfindnexti64 (long, struct _wfinddatai64_t*);
-#if __MSVCRT_VERSION__ >= 0x0601
-_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); 
-_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*);
-#endif /* __MSVCRT_VERSION__ >= 0x0601 */
-#endif /* defined (__MSVCRT__) */
-#define _WIO_DEFINED
-#endif /* _WIO_DEFINED */
+#ifndef _OFF_T_DEFINED
+#define _OFF_T_DEFINED
+  typedef long _off_t;
+#ifndef NO_OLDNAMES
+  typedef long off_t;
+#endif
+#endif
 
-#ifndef _WDIRECT_DEFINED
-/* Also in direct.h */
-#ifdef __MSVCRT__ 
-_CRTIMP int __cdecl __MINGW_NOTHROW      _wchdir (const wchar_t*);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW  _wgetcwd (wchar_t*, int);
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW  _wgetdcwd (int, wchar_t*, int);
-_CRTIMP int __cdecl __MINGW_NOTHROW      _wmkdir (const wchar_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW      _wrmdir (const wchar_t*);
-#endif /* __MSVCRT__ */
-#define _WDIRECT_DEFINED
-#endif /* _WDIRECT_DEFINED */
+#ifndef _OFF64_T_DEFINED
+#define _OFF64_T_DEFINED
+  __MINGW_EXTENSION typedef long long _off64_t;
+#ifndef NO_OLDNAMES
+  __MINGW_EXTENSION typedef long long off64_t;
+#endif
+#endif
 
 #ifndef _STAT_DEFINED
-/*
- * The structure manipulated and returned by stat and fstat.
- *
- * NOTE: If called on a directory the values in the time fields are not only
- * invalid, they will cause localtime et. al. to return NULL. And calling
- * asctime with a NULL pointer causes an Invalid Page Fault. So watch it!
- */
-struct _stat
-{
-       _dev_t  st_dev;         /* Equivalent to drive number 0=A 1=B ... */
-       _ino_t  st_ino;         /* Always zero ? */
-       _mode_t st_mode;        /* See above constants */
-       short   st_nlink;       /* Number of links. */
-       short   st_uid;         /* User: Maybe significant on NT ? */
-       short   st_gid;         /* Group: Ditto */
-       _dev_t  st_rdev;        /* Seems useless (not even filled in) */
-       _off_t  st_size;        /* File size in bytes */
-       time_t  st_atime;       /* Accessed date (always 00:00 hrs local
-                                * on FAT) */
-       time_t  st_mtime;       /* Modified time */
-       time_t  st_ctime;       /* Creation time */
-};
-
-#ifndef        _NO_OLDNAMES
-/* NOTE: Must be the same as _stat above. */
-struct stat
-{
-       _dev_t  st_dev;         /* Equivalent to drive number 0=A 1=B ... */
-       _ino_t  st_ino;         /* Always zero ? */
-       _mode_t st_mode;        /* See above constants */
-       short   st_nlink;       /* Number of links. */
-       short   st_uid;         /* User: Maybe significant on NT ? */
-       short   st_gid;         /* Group: Ditto */
-       _dev_t  st_rdev;        /* Seems useless (not even filled in) */
-       _off_t  st_size;        /* File size in bytes */
-       time_t  st_atime;       /* Accessed date (always 00:00 hrs local
-                                * on FAT) */
-       time_t  st_mtime;       /* Modified time */
-       time_t  st_ctime;       /* Creation time */
-};
-#endif /* _NO_OLDNAMES */
-
-#if defined (__MSVCRT__)
-struct _stati64 {
+#define _STAT_DEFINED
+
+  struct _stat32 {
     _dev_t st_dev;
     _ino_t st_ino;
     unsigned short st_mode;
@@ -429,55 +369,456 @@ struct _stati64 {
     short st_uid;
     short st_gid;
     _dev_t st_rdev;
-    __int64 st_size;
+    _off_t st_size;
+    __time32_t st_atime;
+    __time32_t st_mtime;
+    __time32_t st_ctime;
+  };
+
+  struct _stat {
+    _dev_t st_dev;
+    _ino_t st_ino;
+    unsigned short st_mode;
+    short st_nlink;
+    short st_uid;
+    short st_gid;
+    _dev_t st_rdev;
+    _off_t st_size;
     time_t st_atime;
     time_t st_mtime;
     time_t st_ctime;
-    };
+  };
 
-struct __stat64
-{
+#ifndef        NO_OLDNAMES
+  struct stat {
     _dev_t st_dev;
     _ino_t st_ino;
-    _mode_t st_mode;
+    unsigned short st_mode;
     short st_nlink;
     short st_uid;
     short st_gid;
     _dev_t st_rdev;
-    __int64 st_size;
+    _off_t st_size;
+    time_t st_atime;
+    time_t st_mtime;
+    time_t st_ctime;
+  };
+#endif
+
+#if _INTEGRAL_MAX_BITS >= 64
+
+  struct _stat32i64 {
+    _dev_t st_dev;
+    _ino_t st_ino;
+    unsigned short st_mode;
+    short st_nlink;
+    short st_uid;
+    short st_gid;
+    _dev_t st_rdev;
+    __MINGW_EXTENSION __int64 st_size;
+    __time32_t st_atime;
+    __time32_t st_mtime;
+    __time32_t st_ctime;
+  };
+
+  struct _stat64i32 {
+    _dev_t st_dev;
+    _ino_t st_ino;
+    unsigned short st_mode;
+    short st_nlink;
+    short st_uid;
+    short st_gid;
+    _dev_t st_rdev;
+    _off_t st_size;
     __time64_t st_atime;
     __time64_t st_mtime;
     __time64_t st_ctime;
-};
-#endif  /* __MSVCRT__ */
-#define _STAT_DEFINED
-#endif /* _STAT_DEFINED */
-
-#if !defined ( _WSTAT_DEFINED)
-/* also declared in sys/stat.h */
-#if defined __MSVCRT__
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wstat (const wchar_t*, struct _stat*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    _wstati64 (const wchar_t*, struct _stati64*);
-#if __MSVCRT_VERSION__ >= 0x0601
-_CRTIMP int __cdecl __MINGW_NOTHROW _wstat64 (const wchar_t*, struct __stat64*);
-#endif /* __MSVCRT_VERSION__ >= 0x0601 */
-#endif  /* __MSVCRT__ */
+  };
+
+  struct _stat64 {
+    _dev_t st_dev;
+    _ino_t st_ino;
+    unsigned short st_mode;
+    short st_nlink;
+    short st_uid;
+    short st_gid;
+    _dev_t st_rdev;
+    __MINGW_EXTENSION __int64 st_size;
+    __time64_t st_atime;
+    __time64_t st_mtime;
+    __time64_t st_ctime;
+  };
+#endif
+
+#define __stat64 _stat64
+
+#endif
+
+#ifndef _WSTAT_DEFINED
 #define _WSTAT_DEFINED
-#endif /* ! _WSTAT_DEFIND  */
+  _CRTIMP int __cdecl _wstat(const wchar_t *_Name,struct _stat *_Stat);
+  _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat);
+#if _INTEGRAL_MAX_BITS >= 64
+  _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat);
+  _CRTIMP int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat);
+  _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
+#endif
+#endif
+#endif
 
-#ifndef _WLOCALE_DEFINED  /* also declared in locale.h */
-_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wsetlocale (int, const wchar_t*);
-#define _WLOCALE_DEFINED
+#ifndef _WCONIO_DEFINED
+#define _WCONIO_DEFINED
+  _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer);
+  _CRTIMP wint_t __cdecl _getwch(void);
+  _CRTIMP wint_t __cdecl _getwche(void);
+  _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh);
+  _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh);
+  _CRTIMP int __cdecl _cputws(const wchar_t *_String);
+  _CRTIMP int __cdecl _cwprintf(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _cwscanf(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _cwscanf_l(const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _vcwprintf(const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl _cwprintf_p(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _vcwprintf_p(const wchar_t *_Format,va_list _ArgList);
+
+  _CRTIMP int __cdecl _cwprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _vcwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  wint_t __cdecl _putwch_nolock(wchar_t _WCh);
+  wint_t __cdecl _getwch_nolock(void);
+  wint_t __cdecl _getwche_nolock(void);
+  wint_t __cdecl _ungetwch_nolock(wint_t _WCh);
 #endif
 
-#endif /* not __STRICT_ANSI__ */
+#ifndef _WSTDIO_DEFINED
+#define _WSTDIO_DEFINED
 
-#ifdef __cplusplus
-}      /* end of extern "C" */
+#ifdef _POSIX_
+  _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode);
+#else
+  _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag);
 #endif
 
-#endif /* Not RC_INVOKED */
+  _CRTIMP_ALT wint_t __cdecl fgetwc(FILE *_File);
+  _CRTIMP wint_t __cdecl _fgetwchar(void);
+  _CRTIMP wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
+  _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
+  _CRTIMP wint_t __cdecl getwc(FILE *_File);
+  _CRTIMP wint_t __cdecl getwchar(void);
+  _CRTIMP wint_t __cdecl putwc(wchar_t _Ch,FILE *_File);
+  _CRTIMP wint_t __cdecl putwchar(wchar_t _Ch);
+  _CRTIMP_ALT wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File);
+  _CRTIMP wchar_t *__cdecl fgetws(wchar_t *_Dst,int _SizeInWords,FILE *_File);
+  _CRTIMP int __cdecl fputws(const wchar_t *_Str,FILE *_File);
+  _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String);
+  _CRTIMP int __cdecl _putws(const wchar_t *_Str);
+  _CRTIMP int __cdecl fwprintf(FILE *_File,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl wprintf(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _scwprintf(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl vfwprintf(FILE *_File,const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl vwprintf(const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl swprintf(wchar_t*, const wchar_t*, ...);
+  _CRTIMP int __cdecl vswprintf(wchar_t*, const wchar_t*,va_list);
+  _CRTIMP int __cdecl _swprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _vswprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args);
+#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
+  _CRTIMP int __cdecl snwprintf (wchar_t *s, size_t n, const wchar_t * format, ...);
+  __CRT_INLINE int __cdecl vsnwprintf (wchar_t *s, size_t n, const wchar_t *format, va_list arg) { return _vsnwprintf(s,n,format,arg); }
+  _CRTIMP int __cdecl vwscanf (const wchar_t *, va_list);
+  _CRTIMP int __cdecl vfwscanf (FILE *,const wchar_t *,va_list);
+  _CRTIMP int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list);
+#endif
+  _CRTIMP int __cdecl _fwprintf_p(FILE *_File,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _wprintf_p(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _vfwprintf_p(FILE *_File,const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl _vwprintf_p(const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl _swprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _vswprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl _scwprintf_p(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _vscwprintf_p(const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl _wprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _wprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _vwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  _CRTIMP int __cdecl _fwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _fwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _vfwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  _CRTIMP int __cdecl _vfwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  _CRTIMP int __cdecl _swprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _swprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _vswprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  _CRTIMP int __cdecl _vswprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  _CRTIMP int __cdecl _scwprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  _CRTIMP int __cdecl _snwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _vsnwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  _CRTIMP int __cdecl _swprintf(wchar_t *_Dest,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args);
+  _CRTIMP int __cdecl __swprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,...);
+  _CRTIMP int __cdecl __vswprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,va_list _Args);
+
+#ifdef _CRT_NON_CONFORMING_SWPRINTFS
+#ifndef __cplusplus
+#define swprintf _swprintf
+#define vswprintf _vswprintf
+#define _swprintf_l __swprintf_l
+#define _vswprintf_l __vswprintf_l
+#endif
+#endif
 
-#endif /* not _WCHAR_H_ */
+  _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix);
+  _CRTIMP int __cdecl _vscwprintf(const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl _vscwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
+  int __cdecl fwscanf(FILE *_File,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _fwscanf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
+  int __cdecl swscanf(const wchar_t *_Src,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _swscanf_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP int __cdecl _snwscanf(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _snwscanf_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
+  int __cdecl wscanf(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl _wscanf_l(const wchar_t *_Format,_locale_t _Locale,...);
+  _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode);
+  _CRTIMP FILE *__cdecl _wfopen(const wchar_t *_Filename,const wchar_t *_Mode);
+  _CRTIMP FILE *__cdecl _wfreopen(const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile);
+
+#ifndef _CRT_WPERROR_DEFINED
+#define _CRT_WPERROR_DEFINED
+  _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
+#endif
+  _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode);
+#if !defined(NO_OLDNAMES) && !defined(wpopen)
+#define wpopen _wpopen
+#endif
+  _CRTIMP int __cdecl _wremove(const wchar_t *_Filename);
+  _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer);
+  _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File);
+  _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File);
+  _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File);
 
+#undef _CRT_GETPUTWCHAR_NOINLINE
 
+#if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE)
+#define getwchar() fgetwc(stdin)
+#define putwchar(_c) fputwc((_c),stdout)
+#else
+  __CRT_INLINE wint_t __cdecl getwchar() {return (fgetwc(stdin)); }
+  __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) {return (fputwc(_C,stdout)); }
+#endif
+
+#define getwc(_stm) fgetwc(_stm)
+#define putwc(_c,_stm) fputwc(_c,_stm)
+#define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm)
+#define _getwc_nolock(_c) _fgetwc_nolock(_c)
+#endif
+
+#ifndef _WSTDLIB_DEFINED
+#define _WSTDLIB_DEFINED
+
+  _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix);
+  _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix);
+  _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix);
+  double __cdecl wcstod(const wchar_t *_Str,wchar_t **_EndPtr);
+  _CRTIMP double __cdecl _wcstod_l(const wchar_t *_Str,wchar_t **_EndPtr,_locale_t _Locale);
+  float __cdecl wcstof( const wchar_t *nptr, wchar_t **endptr);
+#if !defined __NO_ISOCEXT /* in libmingwex.a */
+  float __cdecl wcstof (const wchar_t * __restrict__, wchar_t ** __restrict__);
+  long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
+#endif /* __NO_ISOCEXT */
+  long __cdecl wcstol(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
+  _CRTIMP long __cdecl _wcstol_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
+  unsigned long __cdecl wcstoul(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
+  _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
+  _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName);
+#ifndef _CRT_WSYSTEM_DEFINED
+#define _CRT_WSYSTEM_DEFINED
+  _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
+#endif
+  _CRTIMP double __cdecl _wtof(const wchar_t *_Str);
+  _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale);
+  _CRTIMP int __cdecl _wtoi(const wchar_t *_Str);
+  _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale);
+  _CRTIMP long __cdecl _wtol(const wchar_t *_Str);
+  _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
+
+#if _INTEGRAL_MAX_BITS >= 64
+  __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix);
+  __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
+  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
+  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale);
+  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
+  __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
+  __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
+  __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
+#endif
+#endif
+
+#ifndef _POSIX_
+#ifndef _WSTDLIBP_DEFINED
+#define _WSTDLIBP_DEFINED
+  _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords);
+  _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext);
+#ifndef _CRT_WPERROR_DEFINED
+#define _CRT_WPERROR_DEFINED
+  _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
+#endif
+  _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString);
+  _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath);
+  _CRTIMP void __cdecl _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext);
+#endif
+#endif
+
+#ifndef _WSTRING_DEFINED
+#define _WSTRING_DEFINED
+  _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str);
+  wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source);
+  _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
+  int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2);
+  wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source);
+  size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control);
+  size_t __cdecl wcslen(const wchar_t *_Str);
+  size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount);
+  wchar_t *__cdecl wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
+  int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
+  wchar_t *__cdecl wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
+  _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control);
+  _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
+  size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control);
+  _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr);
+  wchar_t *__cdecl wcstok(wchar_t *_Str,const wchar_t *_Delim);
+  _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum);
+  _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str);
+  _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
+  _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
+  _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
+  _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
+  _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
+  _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str);
+  _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val);
+  _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String);
+  _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale);
+  _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String);
+  _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale);
+  size_t __cdecl wcsxfrm(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount);
+  _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale);
+  int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2);
+  _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
+  _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
+  _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
+  _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
+  _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
+  _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
+  _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
+
+#ifndef        NO_OLDNAMES
+  _CRTIMP wchar_t *__cdecl wcsdup(const wchar_t *_Str);
+#define wcswcs wcsstr
+  _CRTIMP int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
+  _CRTIMP int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
+  _CRTIMP wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
+  _CRTIMP wchar_t *__cdecl wcsrev(wchar_t *_Str);
+  _CRTIMP wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val);
+  _CRTIMP wchar_t *__cdecl wcslwr(wchar_t *_Str);
+  _CRTIMP wchar_t *__cdecl wcsupr(wchar_t *_Str);
+  _CRTIMP int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
+#endif
+#endif
+
+#ifndef _TM_DEFINED
+#define _TM_DEFINED
+  struct tm {
+    int tm_sec;
+    int tm_min;
+    int tm_hour;
+    int tm_mday;
+    int tm_mon;
+    int tm_year;
+    int tm_wday;
+    int tm_yday;
+    int tm_isdst;
+  };
+#endif
+
+#ifndef _WTIME_DEFINED
+#define _WTIME_DEFINED
+
+  _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm);
+  _CRTIMP wchar_t *__cdecl _wctime32(const __time32_t *_Time);
+  size_t __cdecl wcsftime(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm);
+  _CRTIMP size_t __cdecl _wcsftime_l(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm,_locale_t _Locale);
+  _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer);
+  _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer);
+
+  _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm);
+  _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time);
+  _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords);
+  _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords);
+
+#if _INTEGRAL_MAX_BITS >= 64
+  _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time);
+  _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time);
+#endif
+
+#if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
+#define _INC_WTIME_INL
+#ifdef _USE_32BIT_TIME_T
+__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); }
+#else /* !_USE_32BIT_TIME_T */
+__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); }
+#endif /* !_USE_32BIT_TIME_T */
+#endif /* !defined (RC_INVOKED) && !defined (_INC_WTIME_INL) */
+
+#endif /* _WTIME_DEFINED */
+
+  typedef int mbstate_t;
+  typedef wchar_t _Wint_t;
+
+  wint_t __cdecl btowc(int);
+  size_t __cdecl mbrlen(const char *_Ch,size_t _SizeInBytes,mbstate_t *_State);
+  size_t __cdecl mbrtowc(wchar_t *_DstCh,const char *_SrcCh,size_t _SizeInBytes,mbstate_t *_State);
+  size_t __cdecl mbsrtowcs(wchar_t *_Dest,const char **_PSrc,size_t _Count,mbstate_t *_State);
+  size_t __cdecl wcrtomb(char *_Dest,wchar_t _Source,mbstate_t *_State);
+  size_t __cdecl wcsrtombs(char *_Dest,const wchar_t **_PSource,size_t _Count,mbstate_t *_State);
+  int __cdecl wctob(wint_t _WCh);
+
+#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */
+  wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n);
+  _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n);
+  int wmemcmp(const wchar_t *s1, const wchar_t *s2,size_t n);
+  wchar_t *__cdecl wmemcpy(wchar_t *s1,const wchar_t *s2,size_t n);
+  wchar_t *__cdecl wmemmove(wchar_t *s1, const wchar_t *s2, size_t n);
+  __MINGW_EXTENSION long long __cdecl wcstoll(const wchar_t *nptr,wchar_t **endptr, int base);
+  __MINGW_EXTENSION unsigned long long __cdecl wcstoull(const wchar_t *nptr,wchar_t **endptr, int base);
+#endif /* __NO_ISOCEXT */
+
+  void *__cdecl memmove(void *_Dst,const void *_Src,size_t _MaxCount);
+  void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _MaxCount);
+  __CRT_INLINE int __cdecl fwide(FILE *_F,int _M) { (void)_F; return (_M); }
+  __CRT_INLINE int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || *_P==0); }
+  __CRT_INLINE _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *_S,wchar_t _C,size_t _N) { for (;0<_N;++_S,--_N) if (*_S==_C) return (_CONST_RETURN wchar_t *)(_S); return (0); }
+  __CRT_INLINE int __cdecl wmemcmp(const wchar_t *_S1,const wchar_t *_S2,size_t _N) { for (; 0 < _N; ++_S1,++_S2,--_N) if (*_S1!=*_S2) return (*_S1 < *_S2 ? -1 : +1); return (0); }
+  __CRT_INLINE wchar_t *__cdecl wmemcpy(wchar_t *_S1,const wchar_t *_S2,size_t _N) { return (wchar_t *)memcpy(_S1,_S2,_N*sizeof(wchar_t)); }
+  __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)); }
+  __CRT_INLINE wchar_t *__cdecl wmemset(wchar_t *_S,wchar_t _C,size_t _N) {
+    wchar_t *_Su = _S;
+    for (;0<_N;++_Su,--_N) {
+      *_Su = _C;
+    }
+    return (_S);
+  }
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#pragma pack(pop)
+
+//#include <sec_api/wchar_s.h>
+#endif