OSDN Git Service

Merge Cygwin CVS updates to legacy branch.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Fri, 17 Jun 2016 14:16:01 +0000 (15:16 +0100)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Fri, 17 Jun 2016 14:16:01 +0000 (15:16 +0100)
1  2 
mingwrt/ChangeLog
mingwrt/include/stdint.h
mingwrt/include/stdio.h
mingwrt/include/stdlib.h
mingwrt/include/wchar.h

 -      * include/stdio.h (_getws, _putws, _wfdopen, _wfopen) 
++2016-06-17  Keith Marshall  <keithmarshall@users.sourceforge.net>
++
++      Merge Cygwin CVS updates to legacy branch.
++
++      * include/stdio.h: Merge 2011-11-30 and 2012-08-02 commits.
++      (getc, getchar, putc, putchar): Declare function prototypes.
++      (fopen64, ftello64): Likewise; change implementation classification
++      from __CRT_INLINE to __CRT_ALIAS, to avoid C++ emitted code bloat.
++      (_lock_file, _unlock_file): Add prototypes; modify merge to...
++      [__MSVCRT_VERSION__>=__MSVCR80_DLL]: ...require this.
++
++      * include/stdint.h: Merge 2012-07-30 commit; include <_mingw.h>
++
++      * include/excpt.h: Merge 2012-08-01 commit.
++      (__try1, __except1) [_WIN64]: Add alternative implementations.
++
++      * include/stdlib.h: Merge 2012-08-02 commit.
++      [__MSVCRT__VERSION__>=__MSVCR70_DLL || _WIN32_WINNT >= _WINXP]
++      (_strtoi64, _strtoui64, _wcstoi64, _wcstoui64): Declare prototypes.
++      [__MSVCRT__VERSION__>=__MSVCR80_DLL || _WIN32_WINNT >= _VISTA]
++      (_strtoi64_l, _strtoui64_l, _wcstoi64_l, _wcstoui64_l): Likewise...
++      [!__have_typedef_locale_t] (__need_locale_t): ...and define to get...
++      (locale_t): ...this, by selective inclusion of <locale.h>
++      [__WCHAR_H_SOURCED] (_wcstoi64, _wcstoui64, _wcstoi64_l)
++      (_wcstoui64_l): Make these function prototypes available for selective
++      inclusion by...
++      * include/wchar.h: ...this; merge 2012-08-02 commit.
++      [__MSVCRT__VERSION__>=__MSVCR70_DLL || _WIN32_WINNT >= _WINXP]
++      (_wcstoi64, _wcstoui64): Note availability of function prototypes via
++      selective inclusion of their actual declarations from <stdlib.h>
++      [__MSVCRT__VERSION__>=__MSVCR80_DLL || _WIN32_WINNT >= _VISTA]
++      (_wcstoi64_l, _wcstoui64_l): Likewise.
++
++      * include/limits.h: Merge 2012-08-02 commit.
++      [__STRICT_ANSI__] (PATH_MAX): Suppress definition.
++
++      * include/sys/param.h: Merge 2012-08-02 commit.
++      [PATH_MAX not defined] (MAXPATHLEN): Define it explicitly.
++      [PATH_MAX defined] (MAXPATHLEN): Define it as an alias.
++
 +2016-06-12  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Add typedef and access support for opaque locale_t objects.
 +
 +      * include/locale.h (locale_t, _locale_t): Define opaque types.
 +      [__need_locale_t]: Make them selectively accessible; define...
 +      (__have_typedef_locale_t): ...this, when they are available.
 +      [_LOCALE_H] (_create_locale, _get_current_locale, _free_locale):
 +      Declare function prototypes, on direct <locale.h> inclusion only.
 +      [_LOCALE_H || _WCHAR_H] (_wcreate_locale): Likewise; this is to be
 +      visible on direct inclusion, or when including <wchar.h>
 +
 +      * include/stdio.h [!(_STDIO_H && _WCHAR_T)]: Correct expression of...
 +      [__MSVCR80_DLL || _WIN32_WINNT_VISTA]: ...this subsidiary condition;
 +      for all cases when this is true, (including when [_STDIO_H] alone)...
 +      [!__have_typedef_locale_t] (__need_locale_t): ...define this, and
 +      include <locale.h>, for selective definition of...
 +      (locale_t): ...this.
 +
 +2016-05-19  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Occlude unsupported _S_IFBLK feature; resolve issue [#1146].
 +
 +      * include/sys/stat.h (_MINGW_S_IFBLK_KLUDGE): New feature test macro;
 +      do not define it, and strongly recommend that it remains undefined.
 +      [!_MINGW_S_IFBLK_KLUDGE] (_S_IFBLK, S_IFBLK): Do not define them.
 +      [!_MINGW_S_IFBLK_KLUDGE] (_S_ISBLK, S_ISBLK): Poison them.
 +      [_MINGW_S_IFBLK_KLUDGE] (_S_IFBLK, S_IFBLK): Adjust definitions; use a
 +      modified value, which is guaranteed to be impossible to match in...
 +      [_S_ISBLK, S_ISBLK]: ...these, thus enforcing false test results.
 +
 +2016-05-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Fix a typo in a <sys/stat.h> inline function definition.
 +
 +      * include/sys/stat.h [__MSVCRT_VERSION__ >= __MSVCR80_DLL]
 +      (stat): First argument declared as 'int'; should be 'const char *';
 +      correct it.
 +
 +2016-05-12  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Resolve some strnlen() implementation issues.
 +
 +      * mingwex/strnlen.s (__mingw_strnlen) [!NUL]: Correct termination
 +      logic; should have used jnz, not jz, to skip endpoint adjustment on
 +      scanning past a terminal NUL character code.
 +
 +      * include/string.h [_POSIX_C_SOURCE >= 200809L] (strnlen): Do not
 +      #define it, as this breaks GCC compilation; use __CRT_ALIAS instead,
 +      with __JMPSTUB__ referencing via "oldname" libraries.
 +
 +      * Makefile.in (jmpstub_awk_script, libimpl_awk_script): Adapt to
 +      facilitate assignment of __JMPSTUB__ and __LIBIMPL__ references to
 +      libraries other than libmingwex.a
 +      (strnlen.jmpstub.$OBJEXT): Assign it to all "moldname" libraries prior
 +      to libmoldname80.a, in addition to libcoldname.a, as specified by the
 +      __JMPSTUB__ assignment within <string.h>
 +
 +2016-05-03  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Enforce consistent specification of package version.
 +
 +      * include/_mingw.h: Rename as...
 +      * include/_mingw.h.in: ...this build-time template file.
 +      (__MINGW32_VERSION): Redefine it, in terms of...
 +      (%PACKAGE_VERSION_LONG%): ...this substitution template.
 +      (__MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION)
 +      (__MINGW32_PATCHLEVEL): Likewise, redefine them in terms of...
 +      (%PACKAGE_VERSION_MAJOR%, %PACKAGE_VERSION_MINOR%)
 +      (%PACKAGE_VERSION_PATCH%): ...these.
 +
 +      * configure.ac (AC_CONFIG_SRCDIR): Adjust for renamed file.
 +      (MINGW_AC_CONFIG_EXTRA_SRCDIR): Likewise, for similarly renamed
 +      w32api/include/w32api.h.in file.
 +
 +      * Makefile.in (all-mingwrt-stage-1-only): Add dependency on...
 +      (_mingw.h, w32api.h): ...these; add rule to generate them, using...
 +      (PACKAGE_VERSION_SCRIPT, PACKAGE_VERSION_FORMAT): ...these new macros;
 +      they apply appropriate substitutions to the renamed template files.
 +      (install-mingwrt-headers): Explicitly add _mingwrt.h
 +
 +2016-04-30  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Make strnlen() available for all MSVCRT.DLL versions.
 +
 +      * msvcrt-xref/msvcrt.def.in (strnlen): Mark it as...
 +      (__MINGW_DLSYM): ...this, excluding its exposure in libmsvcrt.dll, and
 +      thus requiring a dlsym() lookup for versions which provide it.
 +
 +      * include/string.h [__MSVCRT_VERSION__>=__MSVCR80_DLL] (strnlen):
 +      Declare prototype, for use from these non-free DLLs, otherwise...
 +      [_POSIX_C_SOURCE >= 200809L] (strnlen): Define it as an alias for...
 +      (__mingw_strnlen): ...this new libmingwex.a function.
 +
 +      * mingwex/strnlen.s: New file; it implements...
 +      (__mingw_strnlen, __mingw_strnlen_s): ...these new functions.
 +
 +      * Makefile.in (libmingwex.a): Add requirement for...
 +      (strnlen.$OBJEXT): ...this; add vpath specification for its source.
 +
 +2016-04-26  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Use correct paths for partially included header files.
 +
 +      * include/io.h include/process.h: Use 'iquote' #include "stdint.h", to
 +      ensure that we get stdint.h from the same include directory.
 +      * include/stdio.h: Likewise for #include "stdarg.h", and "sys/types.h"
 +      * include/wchar.h: Likewise for all of #include "stdio.h", "stdlib.h",
 +      "direct.h", "sys/stat.h", "io.h", "time.h", "locale.h", and "process.h"
 +      * include/dir.h include/dos.h: Likewise for #include "io.h"
 +      * include/direct.h: Likewise for #include "dos.h"
 +
 +2016-04-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Generalize procedure for installing manpages.
 +
 +      * man/dirname.man: Rename it as...
 +      * man/dirname.3.man: ...this, with inherent MANSECT specification.
 +      (TH): Use %PAGEREF% substitution for NAME, MANSECT, and DATE.
 +      (MS-Windows): Do not append \[tm]; it doesn't render well in Windows
 +      console. Further, correct typos; some syntactic adjustments.
 +
 +      * Makefile.in (%:%.man): New rule; define it.
 +      (%.mancopy, %.mancopy-recursive): New rules; define and use with...
 +      (reference_manpage): ...this new macro, defining it to map...
 +      (dirname.3.man): ...this as the reference source file for both of...
 +      (basename.3, dirname.3): ...these installed manpages.
 +      (format_manpage): Add MANSECT and DATE to expansion of...
 +      (%PAGEREF%): ...this sed substitution pattern.
 +
 +2016-04-12  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Update several incorrectly attributed header files.
 +
 +      * include/direct.h include/io.h include/locale.h include/math.h
 +      * include/process.h include/stdio.h include/stdlib.h include/string.h
 +      * include/sys/stat.h include/sys/types.h include/time.h: Identify the
 +      original author as Colin Peters; Rob Savoye merely imported them into
 +      the original CVS repository, when he created it.
 +
 +      * include/wchar.h: Likewise, imported by Rob Savoye, but the original
 +      source file is unattributed.
 +
 +2016-04-11  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Eliminate all references to non-standard __NO_ISOCEXT macro.
 +
 +      * include/math.h: Tidy layout.
 +      [!defined __NO_ISOCEXT]: Do not use this ugly double negative; in any
 +      case, we do not want to encourage users to define such implementation
 +      private macros; instead, prefer to make use of...
 +      [defined _ISOC99_SOURCE]: ...this glibc compatible feature test.
 +      [__STDC_VERSION__ >= 199901L]: Do not require this; it is implied, by
 +      definition, in _ISOC99_SOURCE.
 +      * include/stdio.h [!defined __NO_ISOCEXT]: Likewise; replace with...
 +      [defined _ISOC99_SOURCE]: ...this, throughout.
 +
 +2016-04-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Make resetting of __need_typedef requests more robust.
 +
 +      * include/sys/types.h [__need_off_t, __need___off64_t]
 +      [__need_ssize_t, __need_time_t]: Move corresponding #undef out of, and
 +      after the respective conditional blocks, which provide each associated
 +      typedef, so ensuring that any repeat request is properly reset.
 +      
 +      * include/time.h [__need_time_t]: Always delegate to <sys/types.h> for
 +      typedef, and reset of request, even in cases where...
 +      [_TIME_H]: ...this is already defined.
 +
 +2016-04-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Add a missing comment terminator.
 +
 +      * include/io.h [!(defined _IO_H && defined _WCHAR_H)]: Properly
 +      terminate the comment annotating the closing #endif statement.
 +
 +2016-04-06  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Declare <dir.h> as formally deprecated.
 +
 +      * include/dir.h: Assert copyright.
 +      (pragma GCC system_header): Declare it.
 +      (_DIR_H): Define as multiple inclusion macro.
 +      [!_DIR_H]: Emit "obsolete header" warning message.
 +
 +2016-04-06  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Factor out <wchar.h> vs. <io.h> duplicate declarations.
 +
 +      * include/io.h: Assert copyright; tidy layout.
 +      (_IO_H_): Rename this multiple inclusion guard macro...
 +      (_IO_H): ...to this preferred form; do not define it when...
 +      [__WCHAR_H_SOURCED__]: ...this is defined, in which case declare...
 +      (_waccess, _wchmod, _wcreat, _wopen, _wsopen, _wunlink, _wmktemp)
 +      (_wfindfirst, _wfindnext, _wfindfirst64, _wfindnext64, _wfindfirsti64)
 +      (_wfindnexti64, _wfindfirst32i64, _wfindnext32i64, _wfindfirst64i32)
 +      (_wfindnext64i32, _wfindfirst32, _wfindnext32, _findclose): ...only
 +      these function prototypes, common to <wchar.h>, together with...
 +      (_fsize_t, struct _wfinddata_t, struct _wfinddatai64_t)
 +      (struct __wfinddata64_t, struct _wfinddata64i32_t)
 +      (struct _wfinddata32i64_t, struct __wfinddata32_t): ...these
 +      requisite data type definitions.
 +      (pragma GCC system_header): Declare it.
 +      (__need_intptr_t): Define, and include <stdint.h> to get...
 +      (intptr_t): ...this typedef; neither define it locally, nor define...
 +      (_INTPTR_T_DEFINED): ...this; delete all references.
 +      (_FSIZE_T_DEFINED): Do not define it; delete all references; rather...
 +      [!(defined _IO_H && defined _WCHAR)] (_fsize_t): Define it.
 +      (FILENAME_MAX): Define it unconditionally.
 +      (__struct_finddata_t): New temporary macro; define and use it to...
 +      (struct _finddata_t, struct _wfinddata_t, struct _finddatai64_t)
 +      (struct _wfinddatai64_t, struct __finddata64_t, struct __wfinddata64_t)
 +      (struct _finddata64i32_t, struct _wfinddata64i32_t)
 +      (struct _finddata32i64_t, struct _wfinddata32i64_t)
 +      (struct __finddata32_t, struct __wfinddata32_t): ...define these.
 +
 +      * include/wchar.h (_WFINDDATA_T_DEFINED): Do not define it; delete all
 +      references; filter out associated data type definitions, namely...
 +      (struct _wfinddata_t, struct _wfinddatai64_t): ...these, and also...
 +      (struct __wfinddata64_t, struct _wfinddata64i32_t): ...these, and...
 +      (struct _wfinddata32i64_t, struct __wfinddata32_t): ...these.
 +      (_WIO_DEFINED): Likewise, do not define it; delete all references;
 +      filter out associated function prototype declarations for all of...
 +      (_waccess, _wchmod, _wcreat, _wopen, _wsopen, _wunlink, _wmktemp)
 +      (_wfindfirst, _wfindnext, _wfindfirst64, _wfindnext64, _wfindfirsti64)
 +      (_wfindnexti64, _wfindfirst32i64, _wfindnext32i64, _wfindfirst64i32)
 +      (_wfindnext64i32, _wfindfirst32, _wfindnext32): ...these; reproduce
 +      them by selective inclusion of <io.h>.
 +
 +2016-04-04  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Factor out <wchar.h> vs. <process.h> duplicate declarations.
 +
 +      * include/process.h: Assert copyright; tidy layout.
 +      (_PROCESS_H_): Rename this multiple inclusion guard macro...
 +      (_PROCESS_H): ...to this preferred form; do not define it when...
 +      [__WCHAR_H_SOURCED__]: ...this is defined, in which case declare...
 +      (_wexecl, _wexecle, _wexeclp, _wexeclpe, _wexecv, _wexecve, _wexecvp)
 +      (_wexecvpe, _wspawnl, _wspawnle, _wspawnlp, _wspawnlpe, _wspawnv)
 +      (_wspawnve, _wspawnvp, _wspawnvpe): ...only these functions.
 +      [!__WCHAR_H_SOURCED__] (_PROCESS_H): Define it; declare all functions
 +      normally specified herein, including those listed above, as required.
 +      (_BEGIN_C_DECLS, _END_C_DECLS): Use to wrap extern "C" declarations.
 +      (__need_intptr_t): Define it prior to including <stdint.h>.
 +      (pragma GCC system_header): Declare it.
 +
 +      * include/wchar.h (_WPROCESS_DEFINED): Delete it; filter out...
 +      (_wexecl, _wexecle, _wexeclp, _wexeclpe, _wexecv, _wexecve, _wexecvp)
 +      (_wexecvpe, _wspawnl, _wspawnle, _wspawnlp, _wspawnlpe, _wspawnv)
 +      (_wspawnve, _wspawnvp, _wspawnvpe): ...these function prototypes;
 +      reproduce them, by selective inclusion of <process.h>.
 +
 +2016-04-04  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Enable selective retrieval of intptr typedefs from <stdint.h>.
 +
 +      * include/stdint.h: Assert copyright; tidy layout.
 +      [__need_intptr_t || __need_uintptr_t] (_STDINT_H): Do not define it;
 +      conceal all normally defined data types, except either or both of...
 +      [__need_intptr_t] (intptr_t): ...this, and/or...
 +      [__need_uintptr_t] (uintptr_t): ...this.
 +      (pragma GCC system_header): Declare it.
 +
 +2016-03-29  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Factor out <wchar.h> vs. <sys/stat.h> duplicate declarations.
 +
 +      * include/sys/stat.h: Assert copyright; tidy layout.
 +      (pragma GCC system_header): Declare it.
 +      (_STAT_H_): Rename multiple inclusion guard macro; adopt...
 +      (_SYS_STAT_H): ...this preferred naming convention; however, when...
 +      [__WCHAR_H_SOURCED__] (_SYS_STAT_H): ...do not define it; declare...
 +      (_wstat, _wstati64, _wstat64, _wstat32): ...these functions, and...
 +      (_wstat32i64, _wstat64i32): ...these, as appropriate to user specified
 +      __MSVCRT_VERSION__ and _WIN32_WINNT macro definitions, namely...
 +      [__MSVCRT_VERSION__ >= 0x601]: ...this, updated to become...
 +      [__MSVCRT_VERSION__ >= __MSVCR61_DLL]: ...this; augment it with...
 +      [|| _WIN32_WINNT >= _WIN32_WINNT_WIN2K]: ...this complement; also...
 +      [__MSVCRT_VERSION__ < 0x800]: this, updated to become...
 +      [__MSVCRT_VERSION__ < __MSVCR80_DLL]: ...this; likewise...
 +      [__MSVCRT_VERSION__ >= 0x800]: ...this, which becomes...
 +      [__MSVCRT_VERSION__ >= __MSVCR80_DLL]: ...this.
 +      (__struct_stat_defined): New macro; define, and use it to define...
 +      (struct stat, struct _stat, struct _stati64, struct __stat64)
 +      (struct __stat32, struct _stat32i64, struct _stat64i32): ...these.
 +      [!__WCHAR_H_SOURCED__] (_SYS_STAT_H): Define it; also include
 +      <sys/types.h>, delegating to it the inclusion of <_mingw.h>, and
 +      definition of types size_t and wchar_t; declare all header content,
 +      including that declared when __WCHAR_H_SOURCED__ is defined, unless
 +      already declared as a result of selective inclusion by <wchar.h>
 +      (__need_size_t, __need_wchar_t): Do not define them; consequently,
 +      there is no need to include <stddef.h>; do not do so.
 +
 +      * include/wchar.h (_wstat, _wstati64, _wstat64): Factor out.
 +      (_wstat32, _wstat32i64, _wstat64i32, struct stat, struct _stat)
 +      (struct _stati64, struct __stat64, struct __stat32, struct _stat32i64)
 +      (struct _stat64i32): Likewise; reproduce them by selective inclusion
 +      of <sys/stat.h>
 +
 +2016-03-28  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Factor out <wchar.h> vs. <direct.h> duplicate declarations.
 +
 +      * include/direct.h: Conditionally partition it, such that...
 +      [__WCHAR_H_SOURCED__] (_DIRECT_H): Do not define it; declare only...
 +      (_wchdir, wchar_t, wchar_t, _wmkdir, _wrmdir): ...these, otherwise...
 +      [!__WCHAR_H_SOURCED__] (_DIRECT_H): Define it; expose all content.
 +      (_WDIRECT_DEFINED): Never define it; delete all references.
 +
 +      * include/wchar.h (_WDIRECT_DEFINED): Delete all references.
 +      (_wchdir, wchar_t, wchar_t, _wmkdir, _wrmdir): Delete prototypes;
 +      selectively #include <direct.h> to reproduce them.
 +
 +2016-03-26  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Factor out <direct.h> vs. <dos.h> duplicate declarations.
 +
 +      * include/dos.h: Assert copyright; tidy layout.
 +      (pragma GCC system_header): Declare it.
 +      (_DOS_H_): Rename multiple inclusion guard macro, to adopt...
 +      (_DOS_H): ...this preferred convention; do not define it when...
 +      [__DIRECT_H_SOURCED__]: ...this applies; restrict declarations to...
 +      (struct _diskfree_t): ...this aggregate data type, together with...
 +      [_NO_OLDNAMES] (diskfree_t): ...this alternative name for it, and...
 +      (_getdiskfree): ...this associated function.
 +      [!__DIRECT_H_SOURCED__] (_DOS_H): Define it; expose all content, but
 +      emit a warning that this header is obsolete, and should not be used.
 +      (_BEGIN_C_DECLS, _END_C_DECLS): Use to wrap extern "C" declarations.
 +      (_DISKFREE_T_DEFINED): Do not define it; delete all references.
 +      (__need_wchar_t): Do not define it; it isn't needed here, and hence,
 +      neither is it necessary to #include <stddef.h>; do not do so.  Also,
 +      do not #include <_mingw.h> explicitly, but always #include <io.h>,
 +      which will implicitly #include <_mingw.h> anyway.
 +
 +      * include/direct.h: Assert copyright; tidy layout.
 +      (pragma GCC system_header): Declare it.
 +      (_DIRECT_H_): Rename this multiple inclusion guard macro...
 +      (_DIRECT_H): ...to adopt this preferred naming convention.
 +      (_BEGIN_C_DECLS, _END_C_DECLS): Use to wrap extern "C" declarations.
 +      (_DISKFREE_T_DEFINED, diskfree_t, struct _diskfree_t): Do not define.
 +      (_getdiskfree): Likewise, do not declare prototype; instead...
 +      (__DIRECT_H_SOURCED__): ...define this, and #include <dos.h>; also
 +      delegate indirect inclusion of <_mingw.h> and <io.h> to this, rather
 +      than include them directly; undefine __DIRECT_H_SOURCED__ when done.
 +      (__need_wchar_t): Do not define it, and do not #include <stddef.h>;
 +      although needed, we may inherit it indirectly from <sys/types.h>,
 +      included by <io.h> via <dos.h>.
 +
 +2016-03-26  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Evade CPP mismatched apostrophe warnings in windres comments.
 +
 +      * msvcrt-xref/msvcrt.def.in (; pexports): 1,Gs/doesn't/does not/g
 +
 +2016-03-20  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Factor out <locale.h> vs. <wchar.h> duplicate declarations.
 +
 +      * include/locale.h: Assert copyright; tidy layout.
 +      (_LOCALE_H_): Rename multiple inclusion guard macro, to...
 +      (_LOCALE_H): ...this; do not define it when...
 +      [__WCHAR_H_SOURCED__]: ...this applies; restrict declarations to...
 +      (_wsetlocale): ...just this one visible function prototype.
 +      [!__WCHAR_H_SOURCED__] (_LOCALE_H): Define it; expose all content.
 +      (_WLOCALE_DEFINED): Do not define it; delete all references.
 +      (pragma GCC system_header): Declare it.
 +
 +      * include/wchar.h (_wsetlocale): Delete prototype; maintain its
 +      visibility by selective inclusion of <locale.h> instead.
 +      (_WLOCALE_DEFINED): Delete all references.
 +
 +2016-03-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Resolve some "implicit function declaration" warnings.
 +
 +      * setargv.c (isspace): Include <ctype.h> for declaration.
 +      * cpu_features.h (__cpu_features_init): Declare function prototype.
 +      * crt1.c (_setargv): Likewise; (this isn't needed elsewhere).
 +
 +2016-03-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Factor out <stdlib.h> vs. <wchar.h> duplicate declarations.
 +
 +      * include/stdlib.h [__WCHAR_H_SOURCED__]
 +      (_STDLIB_H): Do not define it; restrict visible declarations to...
 +      (wcstol, wcstoul, wcstod, _wgetenv, _wputenv, _wsearchenv, _wsystem)
 +      (_wmakepath, _wsplitpath, _wfullpath, wcstof, wcstold): ...this subset
 +      of regular <stdlib.h> content; full content is declared only when...
 +      [!__WCHAR_H_SOURCED__] (_STDLIB_H): ...this applies; define it.
 +      (_WSTDLIB_DEFINED): Do not define it; delete all references.
 +      (pragma GCC system_header): Declare it; tidy layout.
 +
 +      * include/wchar.h: Delete duplicated declarations for...
 +      (wcstol, wcstoul, wcstod, _wgetenv, _wputenv, _wsearchenv, _wsystem)
 +      (_wmakepath, _wsplitpath, _wfullpath, wcstof, wcstold): ...these;
 +      include <stdlib.h> selectively, to maintain their visibility.
 +      (_WSTDLIB_DEFINED): Delete all references.
 +
 +2016-03-17  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Relocate misplaced umask() function prototypes.
 +
 +      * include/sys/stat.h (umask, _umask): Declare prototypes; duplicate...
 +      * include/io.h (umask, _umask): ...these; POSIX doesn't expect them
 +      here, but leave them for backward, or Microsoft, compatibility.
 +
 +2016-03-17  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct another _BEGIN_C_DECLS imbalance error.
 +
 +      * include/wchar.h (_BEGIN_C_DECLS): One misplaced, superfluous, and
 +      unbalanced instance deleted; one correctly balanced instance remains.
 +
 +2016-03-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Support installation of headers with empty parts directory.
 +
 +      * Makefile.in (SUB_HEADERS_PRESENT): New macro; define it, and...
 +      (install-mingwrt-headers): ...invoke it; if false, do not perform...
 +      (INSTALL_SUB_HEADERS): ...this.
 +
 +2016-03-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Reinstate typedef for non-standard off64_t.
 +
 +      * include/sys/types.h [!__STRICT_ANSI__] (off64_t): Define it as...
 +      (__off64_t): ...typedef derived from this; although non-standard, it
 +      is gratuitously required when building GCC's libgfortran.a
 +
 +2016-03-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct conditional compilation block nesting errors.
 +
 +      * include/stdio.h include/time.h (_BEGIN_C_DECLS, _END_C_DECLS): Keep
 +      them balanced within, and around, conditional compilation blocks.
 +
 +2016-03-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Feature test _MINGW32_EXTENDED_SOURCE renamed.
 +
 +      * include/_mingw.h (_MINGW32_EXTENDED_SOURCE): Rename to...
 +      (_MINGW32_SOURCE_EXTENDED): ...this, to improve naming consistency...
 +      (_XOPEN_SOURCE_EXTENDED): ...with this POSIX-XSI feature test.
 +      (__USE_MINGW_ANSI_STDIO): Note that it is intended for internal use;
 +      users should enable any conventional feature test which implies it.
 +
 +      * include/time.h (_MINGW32_EXTENDED_SOURCE): Update references...
 +      (_MINGW32_SOURCE_EXTENDED): ...i.e. to refer to this.
 +
 +2016-02-28  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct atexit() and _onexit() export declaration regression.
 +
 +      * msvcrt-xref/msvcrt.def.in (atexit, _onexit): These must be exported
 +      as DATA; declare them accordingly.
 +
 +2016-02-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Refactor to make <parts/time.h> and <parts/wchar.h> redundant.
 +
 +      * include/string.h: Tidy layout.
 +      (__STRING_H_SOURCED__): New macro; define it at start; delete at end.
 +      (_stricmp, _strnicmp): Include their prototypes, selectively from...
 +      * include/strings.h [__STRING_H_SOURCED__]: ...here, reproduce them...
 +      * include/parts/strings.h: ...from here; file is obsolete; delete it.
 +
 +      * include/string.h (_wcscmpi): Define alias.
 +      (wcscat, wcschr, wcscmp, wcscoll, wcscpy, wcscspn, wcslen, wcsncat)
 +      (wcsncmp, wcsncpy, wcspbrk, wcsrchr, wcsspn, wcsstr, wcstok, wcsxfrm)
 +      (_wcsdup, _wcsicmp, _wcsicoll, _wcslwr, _wcsnicmp, _wcsnset, _wcsrev)
 +      (_wcsset, _wcsupr, _wcsncoll, _wcsnicoll, _wcserror, __wcserror)
 +      (wcscmpi, wcscmpi, wcsdup, wcsicmp, wcsicoll, wcslwr, wcsnicmp)
 +      (wcsnset, wcsrev, wcsset, wcsupr): Selectively include prototypes...
 +      * include/wchar.h [__STRING_H_SOURCED__]: ...from here; reproduce...
 +      * include/parts/wchar.h: ...from here; file is obsolete; delete it.
 +
 +      * include/strings.h (_STRINGS_H): Do not define it, when...
 +      [__STRING_H_SOURCED__]: ...selectively included by <string.h>.
 +      * include/wchar.h (_WCHAR_H) [__STRING_H_SOURCED__]: Likewise.
 +
 +2016-02-16  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Refactor to make <parts/time.h> redundant.
 +
 +      * include/sys/types.h (time_t, __time32_t, __time32_t)
 +      [__need_time_t && !__have_typedef_time_t]: Reproduce definitions...
 +      * include/parts/time.h: ...from here; preserve selective exposure.
 +
 +      * include/time.h (time_t, __time32_t, __time32_t): Get them...
 +      * include/sys/types.h: ...from here, by selective inclusion.
 +
 +      * include/time.h (struct timespec, struct __mingw_extended_timespec)
 +      [__need_struct_timespec && !__struct_timespec_defined]: Reproduce...
 +      * include/parts/time.h: ...from here; preserve selective exposure.
 +
 +      * include/parts/time.h: Delete file; it is no longer required.
 +
 +2016-02-16  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Declare the nanosleep() function where POSIX expects it.
 +
 +      * include/time.h (__mingw_sleep): Declare function prototype.
 +      (nanosleep): Declare prototype, and provide in-line implementation;
 +      this is a reproduction of the original implementation, relocated...
 +      * include/unistd.h (nanosleep): ...from here; remove it; hence...
 +      (struct timespec): ...this need not be declared here, and there is
 +      no need to include <parts/time.h>; remove reference.
 +
 +2016-02-15  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Refactor <time.h> vs. <wchar.h> to avoid duplication.
 +
 +      * include/wchar.h (__WCHAR_H_SOURCED__): New macro; define it...
 +      [_WCHAR_H]: ...at start of processing in this scope; delete at end.
 +      (struct tm): Delete definition; delegate it, together with each of...
 +      (_wctime, _wasctime, _wstrdate, _wstrtime, _wctime64, _wctime32)
 +      (wcsftime): ...these function prototypes; delete them, but note in
 +      comments, that they remain declared, via delegation to...
 +      * include/time.h: ...this; include it selectively, subject to...
 +      [defined __WCHAR_H_SOURCED__](__need_wchar_decls): ...this; define it.
 +      [defined __WCHAR_H_SOURCED__](_TIME_H): Suppress its definition.
 +      [_TIME_H]: Process all definitions and declarations; otherwise...
 +      [__need_wchar_decls]: ...process only <wchar.h> shared content, but...
 +      [_TIME_H && _WCHAR_H]: ...not on second, or later, time of processing.
 +      (_WTIME_DEFINED): Obsolete macro; delete all references.
 +
 +2016-02-11  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Implement support for POSIX "%n$*m$" printf() format control.
 +
 +      * mingwex/stdio/pformat.c (NL_ARGMAX): New macro; nominally, it should
 +      be defined in <limits.h>, but MinGW may not do so; provide a fallback.
 +      (__pformat_inline__): New macro; define, and use it where appropriate.
 +      (PFORMAT_CONVERSION_TYPE, PFORMAT_LENGTH_MODIFIER)
 +      (PFORMAT_TYPE_DOUBLE, PFORMAT_TYPE_INTEGER, PFORMAT_TYPE_POINTER)
 +      (PFORMAT_LENGTH_DEFAULT): New enumerated values; define them.
 +      (PFORMAT_ARGMAP_ENTRIES): New enumerated value tally; use it in...
 +      (__pformat_argmap_t): ...this new union data type; define it.
 +      (__pformat_indexed_argc, __pformat_sizeof_argument, __pformat_argmap)
 +      (__pformat_imul10plus, __pformat_arg_index, __pformat_read_arg_index)
 +      (__pformat_read_arg_index_after, __pformat_look_ahead_beyond_flags)
 +      (__pformat_look_ahead, __pformat_ignore_flags, __pformat_is_ldouble)
 +      (__pformat_is_conversion_type, __pformat_is_alt_ldouble_modifier)
 +      (__pformat_length_modifier, __pformat_check_length_modifier): New
 +      locally defined static and/or inline functions; implement, and...
 +      (__pformat): ...use them.
 +
 +2016-02-11  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Add prototypes for Microsoft's _printf_p() family of functions.
 +
 +      * include/stdio.h [>=__MSVCR80_DLL || >=_WIN32_WINNT_VISTA]
 +      (_printf_p, _printf_p_l, _vprintf_p, _vprintf_p_l, _fprintf_p)
 +      (_fprintf_p_l, _vfprintf_p, _vfprintf_p_l, _sprintf_p, _sprintf_p_l)
 +      (_vsprintf_p, _vsprintf_p_l): Add function prototypes; they require
 +      either a non-free MSVC runtime, or MSVCRT.DLL from Vista onward.
 +      (_wprintf_p, _wprintf_p_l, _vwprintf_p, _vwprintf_p_l, _fwprintf_p)
 +      (_fwprintf_p_l, _vfwprintf_p, _vfwprintf_p_l, _swprintf_p)
 +      (_swprintf_p_l, _vswprintf_p, _vswprintf_p_l): Likewise; make them
 +      available for selective inclusion by both <stdio.h> and <wchar.h>...
 +      [_STDIO_H || __WCHAR_H_SOURCED__]: ...when either of these defined.
 +
 +2016-02-09  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Adapt msvcrt-xref to become msvcrt.def.in provider.
 +
 +      * Makefile.in (msvcrt_version_script) [__MSVCRT_VERSION__]: Adjust
 +      filter value assignment; scale it upwards, by a factor of 0x10000.
 +      (%.def.in) [vpath]: Make it refer to msvcrt-xref directory.
 +      (%.def) [msvcr*]: Do not preserve comments; define...
 +      (__DLLNAME__): ...this preprocessor symbol.
 +
 +      * msvcrt.def.in: Content is obsolete; delete file and replace with...
 +      * msvcrt-xref/msvcrt.def.in: ...this updated alternative.
 +      (__MINGW_DLSYM): New preprocessor macro; define it conditionally...
 +      [__MSVCRT_VERSION__ != 0]: ...to emit in-scope symbols it declares...
 +      [__MSVCRT_VERSION__ == 0]: ...to hide symbols it declares, followed by
 +      redefinition of __MSVCRT_VERSION__ itself, to a value of 0x10000.
 +
 +2016-02-09  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Import msvcrt-xref documentation resources.
 +
 +      * msvcrt-xref: New directory.
 +      * msvcrt-xref/ChangeLog msvcrt-xref/COPYING: New files.
 +      * msvcrt-xref/msvcrt-xref.ms msvcrt-xref/fdl-1.3.ms: New files.
 +      * msvcrt-xref/configure.ac msvcrt-xref/Makefile.in: New files.
 +      * msvcrt-xref/README.in msvcrt-xref/msvcrt.def.in: New files.
 +
 +2016-01-29  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Refactor <stdio.h> vs. <wchar.h> to avoid duplication.
 +
 +      * include/wchar.h: Some minor layout adjustments.
 +      (__WCHAR_H_SOURCED__): New macro; define it temporarily, only while
 +      within the scope of reading <wchar.h>; undefine it at end of file.
 +      (struct tm): Do not define; it is sufficient to keep it opaque.
 +      (FILE, FILENAME_MAX, NULL, __VALIST, off_t, __off64_t, size_t)
 +      (ssize_t, va_list, wchar_t, wint_t): Do not require or define them
 +      directly; delegate to indirect definition by including <stdio.h>.
 +      (fgetwc, fputwc, fgetws, fputws, fwprintf, fwscanf, getwc, getwchar)
 +      (_getws, putwc, putwchar, _putws, snwprintf, _snwprintf, swprintf)
 +      (swscanf, ungetwc, vfwprintf, vfwscanf, _vscwprintf, vsnwprintf)
 +      (_vsnwprintf, vswprintf, vwprintf, vswscanf, vwscanf, _wfdopen)
 +      (_wfopen, _wfreopen, _wfsopen, _wperror, _wpopen, wprintf, _wrename)
 +      (_wremove, wscanf, _wtmpnam, _wtempnam): Omit prototypes; acquire them
 +      indirectly, by selective inclusion from <stdio.h>; hence include it.
 +
 +      * include/stdio.h: Assert copyright; tidy layout.
 +      (_STDIO_H_): Multiple inclusion guard macro, renamed as...
 +      (_STDIO_H): ...this, but defined conditionally, subject to...
 +      [__WCHAR_H_SOURCED__]: ...selectively define and declare only those
 +      entities which are required by <wchar.h>; do not define...
 +      [__WCHAR_H_SOURCED__] (_STDIO_H): ...this; define it only if...
 +      [!__WCHAR_H_SOURCED__]: ...this; define and declare ALL entities which
 +      are normally specified within <stdio.h>, INCLUDING those specifically
 +      itemised above, as selectively required by <wchar.h>.
 +
 +      * pseudo-reloc.c: Some minor layout adjustments.
 +      (WIN32_LEAN_AND_MEAN): Define it; we don't need the windows baggage.
 +      [typedef ptrdiff_t]: Do not assume this is gratuitously defined;
 +      include <stddef.h> to guarantee it.
 +
 +2016-01-29  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Enable selective definition of POSIX system types.
 +
 +      * include/sys/types.h (_SYS_TYPES_H): Do NOT define, if including with
 +      any specific __need_TYPE selector having been set prior to inclusion;
 +      DO define it when no such selector is present, and undefine all such
 +      selectors as may have been set, after evaluation of their effects.
 +      (_DEV_T_, _FPOS64_T_, _INO_T_, _MODE_T_, _OFF_T_, _OFF64_T_, _PID_T_)
 +      (_SIGSET_T_, _SSIZE_T_): Unnecessary guard macros; delete them; this
 +      accommodates reorganization of the file, to achieve a tidier layout.
 +      (__have_typedef_off_t): New repeat definition guard; define it for
 +      compilers which may choke on any repeated typedef for either of...
 +      (off_t, _off_t): ...these; make them selectively defineable for...
 +      [_SYS_TYPES_H && !__have_typedef_off_t]: ...non-selective inclusion...
 +      [__need_off_t && !__have_typedef_off_t]: ...this specific selection;
 +      in either case, redefine them in terms of...
 +      (__off32_t): ...this new internal type, for consistency with...
 +      (__off64_t): ...this previously defined non-standard type; also make
 +      it selectively defineable, either by...
 +      [_SYS_TYPES_H && !__have_typedef___off64_t]: ...non-selective, or...
 +      [__need_off_t && !__have_typedef___off64_t]: ...selective inclusion.
 +      (__have_typedef___off64_t): New repeat definition guard; define it.
 +      (ssize_t, _ssize_t): Also make them selectively defineable, on...
 +      [_SYS_TYPES_H && !__have_typedef_ssize_t]: ...non-selective, or...
 +      [__need_off_t && !__have_typedef_ssize_t]: ...selective inclusion.
 +      (__have_typedef_ssize_t): New repeat definition guard; define it.
 +
 +2015-12-30  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Avoid user namespace pollution by non-standard type 'off64_t'.
 +
 +      * include/sys/types.h (off64_t): Rename it as...
 +      (__off64_t): ...this implementation-private alternative name, so
 +      eliminating the potential for user namespace pollution.
 +
 +      * include/io.h (lseek64): Use '__off64_t', instead of 'off64_t', as
 +      return type, and type of offset argument, in both prototype and inline
 +      implementation; note that this addresses the issue of pollution in the
 +      user namespace, while avoiding the issue of MinGW-Bug [#2024].
 +
 +      * include/stdio.h (fseeko64, __mingw_fseeko64): Use '__off64_t'
 +      instead of 'off64_t', as offset argument type in function prototypes.
 +      (ftello64): Likewise, for return type of inline function.
 +
 +      * mingwex/mingw-fseek.c: Assert copyright; tidy layout.
 +      (WIN32_LEAN_AND_MEAN): Define, to minimize impact of <windows.h>.
 +      (__mingw_fseeko64): Use '__off64_t' per modified function prototype.
 +
 +      * mingwex/stdio/fseeko64.c: Assert copyright.
 +      (fseeko64): Use '__off64_t' per modified function prototype.
 +
 +2015-12-27  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Improve ISO-C conformity in MinGW printf(); cf. MinGW-Bug [#1761]
 +
 +      * mingwex/ofmtctl.c: New file; it implements...
 +      (_mingw_output_format_control): ...this new function; it provides
 +      additional MinGW specific printf() format processing options.
 +
 +      * Makefile.in (libmingwex.a) [prerequisites]: Add ofmtctl.$OBJEXT
 +
 +      * include/stdio.h (_mingw_output_format_control): Declare it.
 +      (_EXPONENT_DIGIT_MASK, _MSVC_PRINTF_QUIRKS, _QUERY_MSVC_PRINTF_QUIRKS)
 +      (_ENABLE_MSVC_PRINTF_QUIRKS, _DISABLE_MSVC_PRINTF_QUIRKS): New
 +      manifest constant expressions; define them.
 +
 +      * mingwex/stdio/pformat.c: Revise licensing terms.
 +      (__pformat) [%le, %lE, %lf, %lF, %lg, %lG, %lx, %lX]: When...
 +      [_mingw_output_format_flag & _MSVC_PRINTF_QUIRKS == 0]: ...ignore `l'
 +      modifier; this matches the behaviour specified by ISO-C99, else...
 +      [_mingw_output_format_flag & _MSVC_PRINTF_QUIRKS != 0]: ...revert to
 +      previous MSVC compatible behaviour, treating it as an `L' modifier.
 +      [!_WIN32] (_MSVC_PRINTF_QUIRKS): Force the zero match case.
 +
 +      * mingwex/ofmt.c (ARGLIST): Subsume references to...
 +      (ARGTYPE): ...this now obsolete macro; delete it throughout.
 +      (update_output_format_flag): New inline function; it restricts flag
 +      operations to affect only Microsoft's exponent digit bits.
 +      [FUNCTION == _set_output_format]: Use it.
 +      [FUNCTION == _get_output_format]: Likewise.
 +
 +2015-10-23  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Make atof() and strtod() conform to ISO-C; fix MinGW-Bug [#2273]
 +
 +      * include/_mingw.h (_ISOC99_SOURCE): Ensure this feature test macro is
 +      defined, when implied by any STDC or POSIX version selection, viz. ...
 +      [__STDC_VERSION__ >= 199901L || _POSIX_C_SOURCE >= 200112L]: ...this.
 +
 +      * include/stdlib.h: Assert copyright; tidy layout.
 +      (_STDLIB_H_): Multiple inclusion guard macro renamed...
 +      (_STDLIB_H): ...to this, preferring no trailing underscore.
 +      [!defined __NO_ISOCEXT]: Delete double negative references; use...
 +      [defined _ISOC99_SOURCE]: ...this feature test instead, when...
 +      (lldiv_t): ...defining this C99 specific aggregate data type, and...
 +      (lldiv, llabs, atoll, strtoll, strtoull, strtof, strtold, wcstof)
 +      (wcstold, _Exit): ...declaring these C99 function prototypes.
 +      (wtoll, lltoa, ulltoa, lltow, ulltow): Mark as deprecated, pending
 +      future removal; not in MSVCRT.DLL, these conform to no known standard.
 +      [__USE_MINGW_ANSI_STDIO] (atof, strtod): Implement inline, using...
 +      (__strtod): ...this libmingwex.a provided function; it handles string
 +      representations of hexadecimal-floats, infinities and NaNs, whereas...
 +      (strtod): ...this MSVCRT.DLL implementation does not.
 +      (__MSVCRT_VERSION__): Prefer symbolic comparison...
 +      [>= __MSVCR80_DLL]: ...for this requirement.
 +
 +2015-10-22  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Rationalize definition of struct timespec.
 +
 +      * include/parts/time.h (struct timespec): Redefine; use __time64_t for
 +      tv_sec field, in place of anonymous union, thus avoiding missing brace
 +      warnings when initializing; leave a copy of the previous definition...
 +      (struct __mingw32_expanded_timespec): ...named thus.
 +
 +      * include/unistd.h (nanosleep): Adjust inline implementation, to match
 +      altered specification of tv_sec field in struct timespec.
 +
 +      * include/_mingw.h (_MINGW32_EXTENDED_SOURCE): New feature test macro.
 +      [! defined __STRICT_ANSI__]: Define it, making it a default feature.
 +
 +      * include/time.h [_MINGW32_EXTENDED_SOURCE] (mingw_timespec): New
 +      convenience function; defined as inline, with __LIBIMPL__ equivalent,
 +      it facilitates interpretation of an instance of struct timespec as if
 +      it were defined as struct __mingw32_expanded_timespec.
 +
 +2015-09-14  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Make strings.h mostly POSIX.1-2008 compliant.
 +
 +      * include/strings.h: Rewritten.  Do not include...
 +      (string.h): ...this; mandated by POSIX.1, it now defines...
 +      (strcasecmp, strncasecmp): ...these POSIX.1 functions, complete with
 +      prototypes, possible in-line implementations, and JMPSTUB references
 +      to corresponding external implementations, which will now become
 +      automatically created within libmingwex.a
 +
 +      * include/parts/strings.h: New file; it declares prototypes for...
 +      (_stricmp, _strnicmp): ...these MSVC functions; nominally declared in
 +      string.h, but we also require them in strings.h
 +
 +      * include/parts/wchar.h: New file; it declares prototypes for all wide
 +      character functions which MSVC specifies in both wchar.h and string.h
 +
 +      * include/string.h: Miscellaneous layout adjustments.
 +      (strcasecmp, strncasecmp): Delete; they belong in strings.h
 +      (_stricmp, _strnicmp): Factor out; include them from parts/strings.h
 +      [!_WSTRING_DEFINED]: Factor out all associated function prototypes;
 +      include them from parts/wchar.h instead.
 +
 +      * include/wchar.h [!_WSTRING_DEFINED]: Delete all associated function
 +      prototypes; include them from parts/wchar.h instead, so making this
 +      guard macro redundant; delete it.
 +
 +      * Makefile.in (strcasecmp.$OBJEXT, strncasecmp.$OBJEXT)
 +      (wcscmpi.$OBJEXT): Implementations are now automatically generated
 +      from header file, for inclusion in libmingwex.a; remove free-standing
 +      implementations from the entire family of liboldname libraries, and...
 +      * strcasecmp.c strncasecmp.c wcscmpi.c: ...delete corresponding source
 +      files; they are no longer required.
 +
 +2015-07-16  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Incorporate build system updates from w32api package.
 +
 +      * Makefile.in (NTDDI_VERSION): Set default to NTDDI_WINNT4.
 +      (mkinstalldirs, INSTALL_DATA): Reimplement to support $(call ...)
 +      (install-strip, uninstall): New make command goals; implement them.
 +      (mingwrt-dist-staged): Use 'install-strip' in this rule; hence...
 +      (devdist, dlldist): ...these have no need to strip explicitly.
 +      (INSTALL_SUB_HEADERS): New macro; implement it, and use it...
 +      (install-mingwrt-headers): ...here.
 +
 +2015-07-14  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Adapt platform feature checks to NTDDI_VERSION conventions.
 +
 +      * include/_mingw.h: Assert copyright; include w32api.h
 +      (UNICODE, _UNICODE): Factor out consistency checks; relocate them
 +      to w32api/include/w32api.h, whence they remain in effect.
 +      (_EXTERN_C, _BEGIN_C_DECLS, _END_C_DECLS): Likewise.
 +
 +2015-07-14  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct mismatched #if/#endif from preceding commit.
 +
 +      * include/_mingw.h (#pragma GCC system_header)
 +      [__GNUC__ >= 3 && ! defined __PCC__]: Merge these conditions, thus
 +      correcting for inadvertent removal of matching #endif introduced by
 +      preceding 2015-06-19 commit.
 +
 +2015-06-19  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Define symbolic names for alternative Microsoft runtime DLLs.
 +
 +      * include/msvcrtver.h: New file; it assigns a value for...
 +      (__MSVCRT_VERSION__): ...this, making its default equivalent to...
 +      (__MSVCR60_DLL): ...this new manifest constant, with each of...
 +      (__MSVCR61_DLL, __MSVCR70_DLL, __MSVCR71_DLL, __MSVCR80_DLL)
 +      (__MSVCR90_DLL, __MSVCR100_DLL, __MSVCR110_DLL, __MSVCR120_DLL):
 +      ...these also defined, as user assignable alternatives.
 +
 +      * include/_mingw.h (__MSVCRT_VERSION__): Use include/msvcrtver.h
 +      to establish its default value.
 +
 +2015-06-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Track dependencies on modified system header files.
 +
 +      * Makefile.in (DEPFLAGS): Use -MD, rather than -MMD.
 +
 +2015-06-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct an anomaly in stage 1 only build procedure.
 +
 +      * Makefile.in (all-gcc): New goal; it is an alias for...
 +      (all-mingwrt-stage-1): ...this, renamed to match configure, as...
 +      (all-mingwrt-stage-1-only): ...this; upate all references.
 +      (active-goals): Adjusted accordingly; it now reguires...
 +      (all-deprecated-mingwrt-stage-1-only): ...this new goal.
 +      (install): Adjusted, as directed by...
 +      (DEFAULT_MAKECMDGOALS): ...this.
 +
 +2015-06-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Prefer our hypot() implementation in complex maths operations.
 +
 +      * mingwex/complex/cabs_generic.c: New file; it replaces...
 +      * mingwex/complex/cabs.c mingwex/complex/cabsf.c: ...all of...
 +      * mingwex/complex/cabsl.c: ...these.
 +
 +      * mingwex/complex/catan_generic.c: New file; it replaces...
 +      * mingwex/complex/catan.c mingwex/complex/catanf.c: ...all of...
 +      * mingwex/complex/catanl.c: ...these.
 +
 +      * mingwex/complex/clog_generic.c: New file; it replaces...
 +      * mingwex/complex/clog.c mingwex/complex/clogf.c: ...all of...
 +      * mingwex/complex/clogl.c: ...these.
 +
 +      * mingwex/complex/cpow_generic.c: New file; it replaces...
 +      * mingwex/complex/cpow.c mingwex/complex/cpowf.c: ...all of...
 +      * mingwex/complex/cpowl.c: ...these.
 +
 +      * mingwex/complex/csqrt_generic.c: Do not use...
 +      (_hypot): ...this Microsoft form of function reference; use...
 +      (hypot): ...this ANSI standard form instead.
 +
 +2015-06-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct C++ compilation anomaly with hypotf() in cmath header.
 +
 +      * include/math.h: Add copyright notice; generally tidy layout.
 +      (_BEGIN_C_DECLS, _END_C_DECLS): Use to wrap extern "C" declarations.
 +      (hypotf): Delete inline implementation; it did not properly handle
 +      range errors, and was uncompilable with optimization when any g++
 +      option implying __STRICT_ANSI__ conformity was specified.
 +      (_MATH_H_): Rename this multiple inclusion guard...
 +      (_MATH_H): ...to this.
 +
 +      * mingwex/math/hypot_generic.c: New file; it implements...
 +      (hypot, hypotf, hypotl): ...these; use the latter pair in place of...
 +      * mingwex/math/hypotf.c mingwex/math/hypotl.c: ...these; delete them.
 +
 +2015-06-08  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Prepare and tag all files for release of mingwrt-3.21.1.
 +
 +      * configure.ac (AC_INIT): Adjust package version argument.
 +      * include/_mingw.h (__MINGW32_PATCHLEVEL): Increment to 1, and...
 +      (__MINGW32_VERSION): ...increment this to match.
 +
 +2015-05-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Refactor to avoid possible time_t conflicts across headers.
 +
 +      * include/parts/time.h (struct timespec): Make it more descriptive of,
 +      and better able to accommodate, potential ambiguity relating to...
 +      (time_t, __time32_t, __time64_t): ...these typedefs; define them here,
 +      whence they may be identically imported into each of...
 +      * include/sys/types.h include/time.h include/wchar.h: these; delete
 +      duplicate typedefs, and import accordingly.
 +
 +      * include/sys/types.h: Add licence; general comment additions.
 +      (_TYPES_H_): Rename multiple inclusion guard macro...
 +      (_SYS_TYPES_H): ...to this.
 +
 +      * include/time.h: Add licence; general comment/layout adjustments.
 +      (_BEGIN_C_DECLS, _END_C_DECLS): Use to wrap extern "C" declarations.
 +      (_TIME_T_DEFINED, _TIME32_T_DEFINED, _TIME64_T_DEFINED)
 +      (_CLOCK_T_DEFINED): Superfluous guard macros; delete them.
 +      (_TIME_H_): Rename multiple inclusion guard macro...
 +      (_TIME_H): ...to this.
 +
 +      * include/unistd.h (nanosleep): Adjust to accommodate redefinition...
 +      (struct timespec): ...of this.
 +
 +      * include/wchar.h: Add licence; general comment/layout adjustments.
 +      (_BEGIN_C_DECLS, _END_C_DECLS): Use to wrap extern "C" declarations.
 +      [GCC] (system_header): Add pragma, identifying header as such.
 +      (_WCHAR_H_): Rename multiple inclusion guard macro...
 +      (_WCHAR_H): ...to this.
 +
 +2015-05-09  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Remove obsolete varargs.h header file.
 +
 +      * include/varargs.h: Delete it; it was a mostly redundant wrapper for
 +      a GCC header which is no longer supported, and was always intended for
 +      ultimate removal; now is the long overdue time to do so.
 +
 +2015-05-08  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct improper unistd.h function attribute declarations.
 +
 +      * include/unistd.h (_cdecl): Correct usage throughout; should be...
 +      (__cdecl): ...this.
 +
 +2015-03-12  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Fix GLOB_DOOFFS initialization bug.
 +
 +      * mingwex/glob.c (__mingw_glob) [!GLOB_DOOFFS]: Ensure...
 +      (gl_data->gl_offs): ...this is properly initialized to zero.
 +
 +2014-12-28  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Tag all files for release of mingwrt-3.21.
 +
 +      * include/_mingw.h: Adjust version accordingly.
 +
 +2014-12-28  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Improve usage notes in stdlib.h, for mkstemp() function.
 +
 +      * include/stdlib.h (MKSTEMP_SETMODE): Explain usage; this is a copy of
 +      an original comment, explaining the need to use  _O_TEMPORARY, from...
 +      * mingwex/mkstemp.c: ...here; delete trailing white space.
 +
 +2014-12-23  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Eliminate some potential definition inconsistencies.
 +
 +      * include/stdio.h: Cosmetic formatting change, relating to...
 +      * include/unistd.h (SEEK_SET, SEEK_CUR, SEEK_END): Define them
 +      unconditionally; this allows the compiler to check for consistency
 +      with their primary definitions in stdio.h
 +
 +2014-12-23  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Suppress expected warning diagnostics in LIBIMPL builds.
 +
 +      * Makefile.in (LIBIMPL_CFLAGS): Redefine it; it now incorporates...
 +      (LIBIMPL_EXTRA_CFLAGS): ...this new macro; it includes the requisite
 +      GCC flag to supress warnings relating to deprecated declarations.
 +
 +2014-12-23  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Provide more POSIX conforming sleep() functions.
 +
 +      * include/sys/types.h (useconds_t): Make it explicitly long; int may
 +      be okay, but doesn't guarantee enough bits; mark as deprecated, since
 +      POSIX has declared it "obsolete", and no longer specifies it.
 +
 +      * mingwex/usleep.c: Delete file; it provided an implementation of...
 +      (usleep): ...this now obsolete function, claiming POSIX.1 issue 6, but
 +      its error handling was hopelessly broken; replace it with...
 +      * mingwex/nsleep.c: ...this new file; it implements...
 +      (__mingw_sleep): ...this generic helper function; it supports sleep
 +      capability with interval specification to nanosecond precision.
 +
 +      * include/unistd.h (__mingw_sleep): Declare prototype; use it as the
 +      basis for providing __LIBIMPL__ __CRT_INLINE implementations of...
 +      (sleep, nanosleep): ...these current POSIX functions, and also...
 +      (usleep): ...this obsolete one; mark it as deprecated.
 +
 +      * include/parts: New directory; it is intended to host partial header
 +      implementations, for content which must be shared among arbitrary sets
 +      of multiple standard header files.
 +
 +      * include/parts/time.h: New file; nominally declaring time.h content.
 +      (struct timespec): Declare it; it is currently used within unistd.h,
 +      to facilitate the __CRT_INLINE implementation of nanosleep().
 +
 +      * Makefile.in (libmingwex.a): Remove reference to...
 +      (usleep.$OBJEXT): ...this; replace it with a reference to...
 +      (nsleep.$OBJEXT): ...this alternative.
 +      (mingwrt-includedirs): Add prerequisite to create...
 +      ($includedir/parts): ...this new directory; it is populated by...
 +      (install-mingwrt-headers): ...this rule; add requisite command.
 +
 +2014-12-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Delete an unnecessary Unicode wrapper file.
 +
 +      * mingwex/wdirent.c: Delete it; Makefile.in knows how to compile the
 +      UTF-16LE API from dirent.c, without any need for this wrapper.
 +
 +2014-12-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Some further inline function rationalization.
 +
 +      * include/io.h (_CRTALIAS): Replace all references...
 +      (__CRT_ALIAS): ...using this syntactically preferred form.
 +      (lseek64): Specify __JMPSTUB__ semantics for extern implementation.
 +      [__cplusplus] (_BEGIN_C_DECLS, _END_C_DECLS): Use these.
 +
 +      * include/unistd.h (ftruncate): Specify __JMPSTUB__ semantics.
 +      [__cplusplus] (_BEGIN_C_DECLS, _END_C_DECLS): Use these.
 +
 +      * mingwex/stdio/lseek64.c: File is now redundant; delete it.
 +      * mingwex/ftruncate.c: Likewise.
 +
 +      * Makefile.in (libmingwex.a): Delete obsolete dependencies on...
 +      (lseek64.$OBJEXT, ftruncate.$OBJEXT): ...these.
 +
 +2014-12-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Some POSIX feature test adjustments.
 +
 +      * include/stdlib.h (mkstemp): Available since SUSv3, so requires...
 +      [_POSIX_C_SOURCE >= 200112L]: ...this minimum level of POSIX support.
 +      (mkdtemp): This didn't become available until SUSv4, so requires...
 +      [_POSIX_C_SOURCE >= 200809L]: ...this increased feature level.
 +
 +2014-12-11  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Another CRT_INLINE function implementation rationalization.
 +
 +      * include/inttypes.h (imaxabs): Specify as __LIBIMPL__; declare...
 +      (llabs): ...this, to be implemented as its __LIBIMPL__ alias.
 +      [__cplusplus] (_BEGIN_C_DECLS, _END_C_DECLS): Use these.
 +
 +      * Makefile.in (libimpl_sed_script): Handle ALIAS attribute.
 +      (libmingwex.a): Delete obsolete dependency on...
 +      (imaxabs.$OBJEXT): ...this.
 +
 +      * mingwex/imaxabs.c: File is now redundant; delete it.
 +
 +2014-12-11  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      More rationalization of CRT_INLINE function implementations.
 +
 +      * include/stdio.h (fopen64): Add __JMPSTUP__ specification.
 +      (ftello64): Add __LIBIMPL__ specification for extern implementation.
 +      [__cplusplus] (_BEGIN_C_DECLS, _END_C_DECLS): Use these.
 +
 +      * mingwex/stdio/fopen64.c: File is now redundant; delete it.
 +      * mingwex/stdio/ftell064.c: Likewise.
 +
 +      * Makefile.in (libmingwex.a): Delete obsolete dependencies on...
 +      (fopen64.$OBJEXT, ftello64.$OBJEXT): ...these.
 +
 +2014-12-11  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Don't implicitly define _POSIX_C_SOURCE too early.
 +
 +      * include/_mingw.h (_POSIX_C_SOURCE): Delay implict definition.
 +      (__USE_MINGW_ANSI_STDIO): This must be initialized first, to ensure
 +      that it is not accidentally activated by implied _POSIX_C_SOURCE.
 +
 +2014-12-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct complex arcsin computation per issue [#2245].
 +
 +      * mingwex/complex/casin_generic.c: New file; it replaces...
 +      * mingwex/complex/casin.c: ...this; it is now obsolete; delete it.
 +      * mingwex/complex/casinf.c mingwex/complex/casinl: Likewise.
 +
 +2014-12-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct complex square root computation per issue [#2246].
 +
 +      * include/math.h (hypotf): Redirect __CRT_INLINE call to...
 +      (_hypot): ...this MSVCRT.DLL exported function, so avoiding...
 +      (hypot): ...this libmoldname.a indirection.
 +
 +      * mingwex/complex/csqrt_generic.c: New file; it replaces...
 +      * mingwex/complex/csqrt.c: ...this; it is now obsolete; delete it.
 +      * mingwex/complex/csqrtf.c mingwex/complex/csqrtl: Likewise.
 +
 +2014-12-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Adjust header guards to resolve issue [#2244].
 +
 +      * include/_mingw.h (_POSIX_C_SOURCE): Define it implicitly...
 +      [_GNU_SOURCE || _BSD_SOURCE || _POSIX_SOURCE || !__STRICT_ANSI__]:
 +      ...when any of these prevail, or as appropriate to correspond with...
 +      [_XOPEN_SOURCE]: ...this; set conformance level accordingly.
 +
 +      * include/math.h [_POSIX_C_SOURCE || defined _USE_MATH_DEFINES]
 +      (M_E, M_LOG2E, M_LOG10E, M_LN2, M_LN10, M_PI, M_PI_2, M_PI_4, M_1_PI)
 +      (M_2_PI, M_2_SQRTPI, M_SQRT2, M_SQRT1_2): Define them, irrespective...
 +      [__STRICT_ANSI__]: ...of this; replace guard accordingly.
 +
 +2014-12-01  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Add implementation of mkstemp() and mkdtemp() functions.
 +
 +      * mingwex/cryptnam.c: New file; it implements...
 +      (__mingw_crypto_tmpname): ...this helper function; it generates a
 +      cryptographically secure sequence of characters, used as the random
 +      component in temporary file and directory names.
 +
 +      * mingwex/mkstemp.c: New file; it implements...
 +      (__mingw_mkstemp): ...this provider of mkstemp() functionality.
 +
 +      * mingwex/mkdtemp.c: New file; it implements...
 +      (__mingw_mkdtemp): ...this provider of mkdtemp() functionality.
 +
 +      * include/stdlib.h (mkstemp): Declare protototye; provide an inline
 +      function implementation, with LIBIMPL extern semantics, in terms of...
 +      (__mingw_mkstemp): ...this; also declare prototype, and define...
 +      (_MKSTEMP_INVOKE, _MKSTEMP_DEFAULT): ...these supporting constants.
 +      (_MKSTEMP_SETMODE): New macro; define it, also providing...
 +      (MKSTEMP_SETMODE) [!_NO_OLDNAMES]: ...this alias.
 +      (mkdtemp): Declare prototype; provide inline implementation, with
 +      JMPSTUB extern semantics, in terms of...
 +      (__mingw_mkdtemp): ...this; declare prototype.
 +
 +      * Makefile.in (libmingwex.a): Add dependency rule, to include...
 +      (mkstemp.$OBJEXT, mkdtemp.$OBJEXT, cryptname.$OBJEXT): ...these.
 +
 +2014-11-30  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      More JMPSTUB rationalization of inline functions.
 +
 +      * include/stdlib.h (_Exit, atoll, lltoa, ulltoa, wtoll, lltow)
 +      (ulltow): Add __JMPSTUB__ declarations; each is REMAPPED to its
 +      appropriate MSVCRT.DLL equivalent entry point.
 +
 +      * mingwex/_Exit.c: File is now redundant; delete it.
 +      * mingwex/atoll.c mingwex/lltoa.c mingwex/ulltoa: Likewise.
 +      * mingwex/wtoll.c mingwex/lltow.c mingwex/ulltow: Likewise.
 +
 +      * Makefile.in (jmpstub_awk_script): Add support for...
 +      [__JMPSTUB__((REMAPPED))]: ...this stub function attribute.
 +      (libmingwex.a): Remove dependencies on deleted files, namely...
 +      (_Exit.$OBJEXT, atoll.$OBJEXT, lltoa.$OBJEXT, ulltoa.$OBJEXT)
 +      (wtoll.$OBJEXT, lltow.$OBJEXT, ulltow.$OBJEXT): ...these.
 +
 +2014-11-29  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct omission of complex conjugate functions from libmingwex.a
 +
 +      * include/complex.h (conj, conjf, conjl): Add LIBIMPL declarations.
 +      (creal, crealf, creall): Likewise, for consistency of implementation.
 +      (cimag, cimagf, cimagl, carg, cargf, cargl): Likewise.
 +
 +      * Makefile.in (libimpl_sed_script): Add processing for __CRT_INLINE
 +      declarations; they should be interpreted analogously to __CRT_ALIAS.
 +      (libmingwex.a): Remove object file references for functions which are
 +      now declared as LIBIMPL, and sort the remainder in ASCII collating
 +      order; deleted function references comprise the set consisting of...
 +      (carg.$OBJEXT, cargf.$OBJEXT, cargl.$OBJEXT): ...these...
 +      (creal.$OBJEXT, crealf.$OBJEXT, creall.$OBJEXT): ...these, and...
 +      (cimag.$OBJEXT, cimagf.$OBJEXT, cimagl.$OBJEXT): ...these.
 +
 +      * mingwex/complex/carg.c: Replaced by LIBIMPL; delete it.
 +      * mingwex/complex/cargf.c mingwex/complex/cargl.c: Likewise.
 +      * mingwex/complex/creal.c mingwex/complex/cimag.c: Likewise.
 +      * mingwex/complex/crealf.c mingwex/complex/cimagf.c: Likewise.
 +      * mingwex/complex/creall.c mingwex/complex/cimagl.c: Likewise.
 +
 +2014-11-24  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Back-port improved asinh() implementation from 4.0-dev branch.
 +
 +      * mingwex/math/asinh_generic.c: New file; it replaces...
 +      * mingwex/math/asinh.c mingwex/math/asinhf.c mingwex/math/asinhl.c:
 +      ...all of these; delete them.
 +
 +2014-11-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Enable remake of lost LIBIMPL object files.
 +
 +      * Makefile.in (libimpl_remake): New macro; define it, and...
 +      (%.libimpl.$OBJEXT) [%.libimpl exists]: ...use it in build rule.
 +
 +2014-11-17  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Implement more robust _get_output_format fallback handling.
 +
 +      * mingwex/ofmt.c: New file; it implements...
 +      (__mingw_output_format_flag): ...backing store, used by...
 +      (__mingw_get_output_format, __mingw_set_output_format): ...these
 +      MSVCRT.DLL version agnostic wrappers/emulators for each of these...
 +      (_get_output_format, _set_output_format): ...MSVCR80.DLL and later
 +      version specific Microsoft APIs, which are also supported by some
 +      later versions of MSVCRT.DLL, (excluding WinXP and earlier).
 +      (__mingw_get_output_format_fallback): Implement; it is aliased to...
 +      (__mingw_set_output_format_fallback): ...this; together they provide
 +      the emulation support for the preceding pair of functions, when they
 +      are not available within the run-time platform MSVCRT.DLL
 +      (__mingw_get_printf_count_output, __mingw_set_printf_count_output):
 +      Implement them; they wrap, and if necessary emulate...
 +      (_get_printf_count_output, _set_printf_count_output): ...these.
 +      (__mingw_get_printf_count_output_fallback): Implement; aliased to...
 +      (__mingw_set_printf_count_output_fallback): ...this; together they are
 +      required to support emulation of the preceding pair of functions, when
 +      they are not available within the run-time platform MSVCRT.DLL
 +
 +      * include/stdio.h (_TWO_DIGIT_EXPONENT): Define it unconditionally.
 +      (_THREE_DIGIT_EXPONENT): New manifest constant; define it orthogonally.
 +      (__mingw_get_output_format, __mingw_set_output_format)
 +      (__mingw_get_printf_count_output, __mingw_set_printf_count_output):
 +      Unconditionally declare their prototypes, for subsequent inline use.
 +      [_MSVCRT_VERSION__ < 0x800] (_get_output_format): Emulate it inline.
 +      [_MSVCRT_VERSION__ < 0x800] (_set_output_format): Likewise.
 +      [_MSVCRT_VERSION__ < 0x800] (_get_printf_count_output): Likewise.
 +      [_MSVCRT_VERSION__ < 0x800] (_set_printf_count_output): Likewise.
 +      (__USE_MINGW_PRINTF): New manifest constant; define it. It is a
 +      counterpart to __USE_MINGW_ANSI_STDIO, which is guaranteed to always
 +      represent a compilable token.
 +
 +      * mingwex/stdio/pformat.c (__pformat_exponent_digits): Do not require
 +      _get_output_format; consult __mingw_output_format_flag directly.
 +
 +      * ofmt_stub.s: No longer required; delete it.
 +
 +      * Makefile.in (ofmt_stub.$OBJEXT): Delete reference.
 +      (PFORMAT_CFLAGS) [__MSVCRT_VERSION__ = 0x800]: Remove requirement.
 +      (varofmt.$OBJEXT, crtofmt.$OBJEXT, getofmt.$OBJEXT, setofmt.$OBJEXT)
 +      (crtnfmt.$OBJEXT, getnfmt.$OBJEXT, setnfmt.$OBJEXT): Add build rule;
 +      all are compiled from ofmt.c
 +
 +2014-11-16  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Do some more essential build tree clean up.
 +
 +      * Makefile.in (mostly-clean-local): Add *.libimpl; matching files get
 +      in the way of a successful rebuild from clean.
 +
 +2014-11-11  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Implement wrappers for emulation of POSIX dlfcn API.
 +
 +      * include/dlfcn.h: New file; it declares the API.
 +      * mingwex/dlfcn.c: New file; implement it, with access via...
 +      (__mingw_dlfcn): ...this publicly addressable vector table.
 +
 +      * Makefile.in (dlfcn.$OBJEXT): Add build requisite.
 +      (dlopen, dlsym, dlclose, dlerror): Build call stubs, using...
 +      (__LIBIMPL__): ...this automatic interface generator; implement it.
 +      (libstub_refnames): New macro; it is adapted from and replaces...
 +      (jmpstub_refs): ...this; when it is then invoked twice to build...
 +      (Makefile.stub): ...this, it handles both JMPSTUB and LIBIMPL.
 +      (jmpstub_awk_script): Adapt it to work with 'libstub_refnames'.
 +      (libimpl_awk_script): New inline script; it handles automated builds
 +      of LIBIMPL interfaces, as 'jmpstub_awk_script' does for JMPSTUB.
 +      (libimpl_sed_script): New inline script; it prepares intermediate C
 +      source code for LIBIMPL interfaces, as required to satisfy these...
 +      (%.libimpl, %.libimpl.$OBJEXT): ...new implicit build objectives.
 +      (LIBIMPL_CFLAGS): New macro; define it.
 +
 +2014-11-08  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Move libgen functions to __mingw_ pseudo-namespace.
 +
 +      * mingwex/dirname.c (dirname): Rename function, as implemented...
 +      (__mingwex_dirname): ...to this.
 +
 +      * mingwex/basename.c (basename): Rename function, as implemented...
 +      (__mingwex_basename): ...to this.
 +
 +      * include/libgen.h (__mingw_dirname, __mingw_basename): Declare
 +      prototypes, matching and augmenting original declarations for...
 +      (dirname, basename): ...these; reimplement as inline aliases, with
 +      __JMPSTUB__ references to the renamed implementation entry points.
 +
 +2014-11-08  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Implement new command line argument globbing strategy.
 +
 +      * include/_mingw.h: Backport feature defines from master...
 +      (__CRT_GLOB_USE_MINGW__, __CRT_GLOB_USE_MSVCRT__): New manifest
 +      constants; define them.  They select the preferred globbing algorithm.
 +      [_CRT_glob & __CRT_GLOB_USE_MINGW__] (__CRT_GLOB_USE_SINGLE_QUOTE__)
 +      (__CRT_GLOB_BRACKET_GROUPS__, __CRT_GLOB_CASE_SENSITIVE__): New option
 +      bit-map constants; define them.  When added to __CRT_GLOB_USE_MINGW__,
 +      they enable optional additional features supported by this algorithm.
 +      (__CRT_GLOB_ESCAPE_CHAR__): New manifest constant; define it.
 +
 +      * CRTglob.c (_CRT_glob): Change default to __CRT_GLOB_USE_MINGW__.
 +
 +      * Makefile.in (libmingw32.a): Add setargv.$OBJEXT, furnished by...
 +      * setargv.c: ...new file; it implements the initialization mechanism
 +      for the __CRT_GLOB_USE_MINGW__ globbing algorithm, when invoked by...
 +      (_setargv) [_CRT_glob & __CRT_GLOB_USE_MINGW__]: ...this new function;
 +      it invokes the algorithm via an API similar to that described by MSDN,
 +      while continuing to support our original _CRT_glob interpretation.
 +      (_setargv) [! _CRT_glob & __CRT_GLOB_USE_MINGW__]: Invoke Microsoft
 +      algorithm, via the MSDN-alike API, by calling back to...
 +
 +      * crt1.c (_mingw32_init_mainargs): ...this original function, now
 +      relocated to here, as a publicly addressable function; formerly...
 +      (__mingw_CRTStartup): ...called directly from here, we now redirect
 +      the call through _setargv(), whence it may be called indirectly.
 +
 +      * init.c: Redundant file; delete it.  It originally provided...
 +      (_mingw32_init_mainargs): ...this, now relocated as noted above, with
 +      original static attribute removed, to allow global addressing.
 +
 +2014-11-07  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Backport glob implementation from master to legacy.
 +
 +      * include/glob.h: New file; copy it from master branch.
 +      (__mingw_glob, __mingw_globfree): Add __JMPSTUB__ aliases for...
 +      (glob, globfree): ...each of these, respectively.
 +
 +      * mingwex/glob.c: New file; copy it from master:src/libcrt/misc.
 +      (CRT_GLOB_HARD_ESCAPE) [ifndef __CRT_GLOB_ESCAPE_CHAR__]: Provide a
 +      fallback definition; default value is ASCII DEL, a.k.a. RUBOUT, code.
 +      (accept_glob_nocheck_match): New static function; it adds support for
 +      avoidance of globbing on patterns with no globbing token, so avoiding
 +      the case transliteration effect reported as MinGW-Bug #2106.
 +      (glob_match): Use it.
 +
 +      * Makefile.in: Build glob.$OBJEXT; add it to libmingwex.a
 +
 +2014-11-05  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Implement conventionally named dirent function trampolines.
 +
 +      * mingwex/jmpstub.sx: New file; it implements a generic trampoline,
 +      which redirects a conventionally named function call to its __mingw_
 +      pseudo-namespace implementation.
 +
 +      * aclocal.m4 (MINGW_AC_PROG_COMPILE_SX): New macro; define it.
 +      * configure.ac (MINGW_AC_PROG_COMPILE_SX): Use it; it identifies the
 +      appropriate protocol for compiling *.sx files, (supported natively by
 +      GCC >= v4.3, but older versions require `-x assembler-with-cpp').
 +
 +      * Makefile.in (COMPILE.sx): New implicit rule; GNU make does not
 +      yet provide it, so we define it ourselves; deploy it for *.sx files.
 +      (Makefile.stub): New sinclude file; create it dynamically, using...
 +      (jmpstub_awk_script): ...this new inline script, which is based on...
 +      (jmpstub_refs, jmpstub_prerequisites): ...these new macros, and...
 +      (mingwex/jmpstub.sx): ...this new file; add vpath reference.
 +      (mostlyclean-local): Remove Makefile.stub; do likewise...
 +      (Makefile): ...when remaking this, to ensure that both will be
 +      remade together.
 +
 +2014-11-03  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Make dirent implementation namespace and time_t clean.
 +
 +      * include/_mingw.h (_EXTERN_C, _BEGIN_C_DECLS, _END_C_DECLS): New
 +      macros; define them.  They facilitate identification of symbols which
 +      must be compiled with `extern "C"' binding, when compiling C++ code.
 +      (__CRT_ALIAS): New macro; define it.  It is intended to replace...
 +      (_CRTALIAS): ...this, which is to be considered as deprecated.
 +      (__JMPSTUB__, __LIBIMPL__): New macros; define them.  They provide
 +      __CRT_ALIAS build hints, while remaining transparent to GCC.
 +      (UNICODE, _UNICODE) [user defined]: Define consistently.
 +
 +      * mingwex/dirent.c: Reimplement; (this is a back-port from the
 +      4.0-dev branch, with additional ABI changes to improve stability).
 +      (opendir, readdir, telldir, seekdir, rewinddir, closedir)
 +      (_wopendir, _wreaddir, _wtelldir, _wseekdir, _wrewinddir, _wclosedir):
 +      Add `__mingw_' prefix to all publicly exposed symbol names.
 +      (dirent_findfirst, dirent_findnext, dirent_findclose): New locally
 +      implemented functions; they replace Microsoft's ambiguously defined
 +      _findfirst, _findnext, and _findclose, so avoiding ABI instability
 +      resulting from the ambiguous size of Microsoft's time_t.
 +
 +      * include/dirent.h (struct dirent, struct _wdirent): Redefine them,
 +      removing unnecessary time_t and file size fields; (our replacements
 +      for _findfirst, and _findnext do not require them to be present).
 +      (DIR, _WDIR): Adjust typedefs; they are now opaque structs.
 +      (opendir, readdir, telldir, seekdir, rewinddir, closedir)
 +      (_wopendir, _wreaddir, _wtelldir, _wseekdir, _wrewinddir, _wclosedir):
 +      Adjust prototypes, making them inline aliases for public symbols which
 +      are now qualified by the `__mingw_' prefix; add build hints to support
 +      compilation of addressable stubs, with the original symbol names.
 +      (DT_REG, DT_DIR, DT_UNKNOWN): New manifest constants; define them.
 +      (DT_BLK, DT_CHR, DT_FIFO, DT_LNK, DT_SOCK): Likewise; (these are for
 +      BSD compatibility, but are fundamentally unsupported on MS-Windows).
 +      (_DIRENT_HAVE_D_TYPE, _DIRENT_HAVE_D_RECLEN, _DIRENT_HAVE_D_NAMLEN):
 +      New macros; define them.  (These show availability of optional fields
 +      within the dirent struct, which client code may wish to access).
 +
 +2014-10-31  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Correct improper naming of assembly language source files.
 +
 +      * mingwex/math/*.S: Rename all files with this extension...
 +      * mingwex/math/*.s: ...to this; (all are simple assembly language, and
 +      not extended `assembler-with-cpp' as implied by the former extension);
 +      adjust all internal `.file <name>' references accordingly.
 +
 +      * Makefile.in (vpath %.S): Adjust reference to locate files....
 +      (vpath %.s): ...now renamed thus.
 +
 +2014-10-29  Keith Marshall  <keithmarshall@users.sourceforge.net>
 +
 +      Streamline the build system infrastructure.
 +
 +      * configure.ac: New file; it replaces...
 +      * configure.in: ...this; (name is obsolete); delete it.
 +
 +      * aclocal.m4 Makefile.in: Substantially rewritten; avoid recursive
 +      make invocations, when processing subdirectories, and add automatic
 +      dependency tracking for all generated files.
 +
 +      * configure: Delete it; as a generated file, it doesn't belong in SCM.
 +
 +      * mingwex/Makefile.in: No longer required; delete it.
 +      * profile/Makefile.in: Likewise.
 +
 +      * mkinstalldirs: Not required; delete it; (make should use `mkdir -p',
 +      or fall back on `install-sh -d', per AC_PROG_MKDIR_P).
 +
 +      * jamfile: Delete it; it hasn't been updated in ages, is likely no
 +      longer relevant, and I have no desire to maintain it.
 +
+ 2012-08-02  Earnie Boyd  <earnie@users.sourceforge.net>
+       Add another more rigorous __STRICT_ANSI__ filter.
+       * include/limits.h [__STRICT_ANSI__] (PATH_MAX): Suppress definition.
+       * include/sys/param.h [PATH_MAX defined] (MAXPATHLEN): Alias it.
+       [PATH_MAX not defined] (MAXPATHLEN): Define it directly.
+ 2012-08-02  Ivan Maidanski  <ivmai@users.sourceforge.net>
+       Add missing function prototypes per issue [#1305].
+       * include/process.h [#ifndef _WPROCESS_DEFINED]
+       (_wexecl, _wexecle, _wexeclp, _wexeclpe, _wexecv, _wexecve)
+       (_wexecvp, _wexecvpe, _wspawnl, _wspawnle, _wspawnlp, _wspawnlpe)
+       (_wspawnv, _wspawnve, _wspawnvp, _wspawnvpe): Declare them.
+ 2012-08-02  Earnie Boyd  <earnie@users.sourceforge.net>
+       Add function prototype declarations per issue [#1293].
+       * include/stdio.h (_lock_file, _unlock_file): Declare them.
+ 2012-08-02  Earnie Boyd  <earnie@users.sourceforge.net>
+       Apply some more rigorous __STRICT_ANSI__ filtering.
 -2011-08-23 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
++      * include/stdio.h (_getws, _putws, _wfdopen, _wfopen)
+       (_wfreopen, _wfsopen, _wtmpnam, _wtempnam, _wrename, _wremove)
+       (_wperror, _wpopen): Do not declare these functions unless...
+       [#ifndef __STRICT_ANSI__]: ...this is satisfied.
+ 2012-08-02  Earnie Boyd  <earnie@users.sourceforge.net>
+       Add string to 64-bit integer conversion function prototypes.
+       * include/stdlib.h (_strtoi64, _strtoi64_l, _strtoui64, _strtoui64_l)
+       (_wcstoi64, _wcstoi64_l, _wcstoui64, _wcstoui64_l): Declare them.
+       * include/wchar.h (_wcstoi64, _wcstoi64_l, _wcstoui64, _wcstoui64_l):
+       Likewise; these are duplicates of the <stdlib.h> declarations.
+ 2012-08-01  Earnie Boyd  <earnie@users.sourceforge.net>
+       Update for _WIN64 exception handler readiness.
+       * include/excpt.h [_WIN64] (__try1, __except1): Add alternative inline
+       assembly code implementation, based on X86-64 architecture.
+ 2012-07-30  Earnie Boyd  <earnie@users.sourceforge.net>
+       Correct missing inclusion of <_mingw.h>.
+       * include/stdint.h: Add omitted #include; all mingwrt headers are
+       expected to include this; it is required to define __int64.
+ 2011-11-30  Ozkan Sezer  <sezero@users.sourceforge.net>
+       Correct prototypes for _wfindfirst()/_wfindnext() function family.
+       * include/io.h (_wfindfirst, _wfindfirst32, _wfindfirsti64)
+       (_wfindfirst32i64, _wfindfirst64i32): Return type changed to intptr_t.
+       (_wfindnext, _wfindnext32, _wfindnexti64, _wfindnext32i64)
+       (_wfindnext64i32, _wfindnext64): Type of parameter #1 must match.
+ 2011-11-30  Earnie Boyd  <earnie@users.sourceforge.net>
+       Avoid potential GCC "missing function prototype" warnings.
+       * include/stdio.h (getc, putc, getchar, putchar, fopen64)
+       (ftello64): Provide a function prototype declaration for each of
+       these, prior to the corresponding inline implementation.
 +2011-08-23  Chris Sutcliffe  <ir0nh34d@users.sourceforge.net>
  
        * include/_mingw.h: Increment version to 3.20.
  
@@@ -1,49 -1,25 +1,54 @@@
 -/* ISO C9x  7.18  Integer types <stdint.h>
 +/*
 + * stdint.h
 + *
 + * Integer type definitions, as prescribed by ISO-C9x Section 7.18
   * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
   *
 - *  THIS SOFTWARE IS NOT COPYRIGHTED
 + * $Id$
 + *
 + * Written by Danny Smith <danny_r_smith_2001@yahoo.co.nz>
 + * Copyright (C) 2000-2002, 2004, 2005, 2007, 2009, 2016, MinGW.org Project.
   *
 - *  Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
   *
 - *  This source code is offered for use in the public domain. You may
 - *  use, modify or distribute it freely.
 + * Permission is hereby granted, free of charge, to any person obtaining a
 + * copy of this software and associated documentation files (the "Software"),
 + * to deal in the Software without restriction, including without limitation
 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 + * and/or sell copies of the Software, and to permit persons to whom the
 + * Software is furnished to do so, subject to the following conditions:
   *
 - *  This code is distributed in the hope that it will be useful but
 - *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
 - *  DISCLAIMED. This includes but is not limited to warranties of
 - *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 + * The above copyright notice, this permission notice, and the following
 + * disclaimer shall be included in all copies or substantial portions of
 + * the Software.
 + *
 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
 + * DEALINGS IN THE SOFTWARE.
   *
 - *  Date: 2000-12-02
   */
 -
 -
  #ifndef _STDINT_H
 +#pragma GCC system_header
 +
 +/* To support selective definition of just intptr_t or uintptr_t,
 + * we defer definition of the normal multiple inclusion guard macro,
 + * until we've determined that neither selection is active.
 + */
 +#if ! defined __need_intptr_t && ! defined __need_uintptr_t
  #define _STDINT_H
 +
++/* All MinGW system headers are expected to include <_mingw.h>;
++ * ensure that we have done so.
++ */
+ #include <_mingw.h>
++
 +/* We need to duplicate the definitions of wint_t and wchar_t, as
 + * they are defined in <stddef.h>; get them, by selective inclusion
 + * from that header itself.
 + */
  #define __need_wint_t
  #define __need_wchar_t
  #include <stddef.h>
@@@ -244,50 -159,41 +244,58 @@@ __MINGW_IMPORT FILE _iob[];     /* An arra
  #define stdout        (&_iob[STDOUT_FILENO])
  #define stderr        (&_iob[STDERR_FILENO])
  
 -#ifdef __cplusplus
 -extern "C" {
 +/* Need to close the current _STDIO_H specific block here...
 + */
  #endif
 +/* ...because, we need this regardless of the inclusion mode...
 + */
 +_BEGIN_C_DECLS
  
 -/*
 +#ifdef _STDIO_H
 +/* ...then revert to _STDIO_H specific mode, to declare...
 + *
 + *
   * File Operations
   */
 -_CRTIMP FILE* __cdecl __MINGW_NOTHROW fopen (const char*, const char*);
 -_CRTIMP FILE* __cdecl __MINGW_NOTHROW freopen (const char*, const char*, FILE*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   fflush (FILE*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   fclose (FILE*);
 -/* MS puts remove & rename (but not wide versions) in io.h  also */
 -_CRTIMP int __cdecl __MINGW_NOTHROW   remove (const char*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   rename (const char*, const char*);
 -_CRTIMP FILE* __cdecl __MINGW_NOTHROW tmpfile (void);
 -_CRTIMP char* __cdecl __MINGW_NOTHROW tmpnam (char*);
 +_CRTIMP __cdecl __MINGW_NOTHROW  FILE * fopen (const char *, const char *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  FILE * freopen (const char *, const char *, FILE *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    fflush (FILE *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    fclose (FILE *);
 +
 +/* Note: Microsoft also declares remove & rename (but not their wide char
 + * variants) in <io.h>; since duplicate prototypes are acceptable, provided
 + * they are consistent, we simply declare them here anyway, while allowing
 + * the compiler to check consistency as appropriate.
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    remove (const char *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    rename (const char *, const char *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  FILE * tmpfile (void);
 +_CRTIMP __cdecl __MINGW_NOTHROW  char * tmpnam (char *);
  
  #ifndef __STRICT_ANSI__
 -_CRTIMP char* __cdecl __MINGW_NOTHROW _tempnam (const char*, const char*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _rmtmp(void);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _unlink (const char*);
 -
 -#ifndef       NO_OLDNAMES
 -_CRTIMP char* __cdecl __MINGW_NOTHROW tempnam (const char*, const char*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   rmtmp(void);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   unlink (const char*);
 +_CRTIMP __cdecl __MINGW_NOTHROW  char *_tempnam (const char *, const char *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int   _rmtmp (void);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int   _unlink (const char *);
 +
++#if __MSVCRT_VERSION__>=__MSVCR80_DLL
++/* The following pair of non-ANSI functions require a non-free version of
++ * the Microsoft runtime; neither is provided by any MSVCRT.DLL variant.
++ */
++_CRTIMP __cdecl __MINGW_NOTHROW  void  _lock_file(FILE *);
++_CRTIMP __cdecl __MINGW_NOTHROW  void  _unlock_file(FILE *);
+ #endif
 -#endif /* __STRICT_ANSI__ */
 -_CRTIMP int __cdecl __MINGW_NOTHROW   setvbuf (FILE*, char*, int, size_t);
 +#ifndef NO_OLDNAMES
 +_CRTIMP __cdecl __MINGW_NOTHROW  char * tempnam (const char *, const char *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    rmtmp (void);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    unlink (const char *);
 +#endif
 +#endif /* __STRICT_ANSI__ */
  
 -_CRTIMP void __cdecl __MINGW_NOTHROW  setbuf (FILE*, char*);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    setvbuf (FILE *, char *, int, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  void   setbuf (FILE *, char *);
  
 -/*
 - * Formatted Output
 +/* Formatted Output
   *
   * MSVCRT implementations are not ANSI C99 conformant...
   * we offer these conforming alternatives from libmingwex.a
@@@ -429,210 -314,87 +437,212 @@@ _CRTIMP int __mingw_stdio_redirect__(vs
  
  #undef  __mingw_stdio_redirect__
  
 -/* The following pair ALWAYS refer to the MSVCRT implementations...
 +/* The following three ALWAYS refer to the MSVCRT implementations...
   */
 -_CRTIMP int __cdecl __MINGW_NOTHROW _snprintf (char*, size_t, const char*, ...);
 -_CRTIMP int __cdecl __MINGW_NOTHROW _vsnprintf (char*, size_t, const char*, __VALIST);
 -_CRTIMP int __cdecl __MINGW_NOTHROW _vscprintf (const char*, __VALIST);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _snprintf (char *, size_t, const char *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _vsnprintf (char *, size_t, const char *, __VALIST);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _vscprintf (const char *, __VALIST);
 +
 +#ifdef _ISOC99_SOURCE
 +/* Microsoft does not provide implementations for the following,
 + * which are required by C99.  Note in particular that Microsoft's
 + * corresponding implementations of _snprintf() and _vsnprintf() are
 + * NOT compatible with C99, but the following are; if you want the
 + * MSVCRT behaviour, you MUST use the Microsoft "uglified" names.
 + */
 +__cdecl __MINGW_NOTHROW  int snprintf (char *, size_t, const char *, ...);
 +__cdecl __MINGW_NOTHROW  int vsnprintf (char *, size_t, const char *, __VALIST);
 +
 +__cdecl __MINGW_NOTHROW  int vscanf (const char * __restrict__, __VALIST);
 +
 +__cdecl __MINGW_NOTHROW
 +int vfscanf (FILE * __restrict__, const char * __restrict__, __VALIST);
 +
 +__cdecl __MINGW_NOTHROW
 +int vsscanf (const char * __restrict__, const char * __restrict__, __VALIST);
 +
 +#endif  /* _ISOC99_SOURCE */
++#endif        /* <stdio.h> included in its own right */
 -#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
 +#if __MSVCRT_VERSION__ >= __MSVCR80_DLL || _WIN32_WINNT >= _WIN32_WINNT_VISTA
  /*
 - * Microsoft does not provide implementations for the following,
 - * which are required by C99.  Note in particular that the corresponding
 - * Microsoft implementations of _snprintf() and _vsnprintf() are *not*
 - * compatible with C99, but the following are; if you want the MSVCRT
 - * behaviour, you *must* use the Microsoft uglified names.
 + * In MSVCR80.DLL, (and its descendants), Microsoft introduced variants
 + * of the printf() functions, with names qualified by an underscore prefix
 + * and "_p" or "_p_l" suffixes; implemented in Microsoft's typically crass,
 + * non-standard, and non-portable fashion, these provide support for access
 + * to printf() arguments in random order, as was standardised by POSIX as a
 + * feature of the optional Extended Systems Interface (XSI) specification,
 + * and is now required for conformity with the POSIX.1-2008 base standard.
 + * Although these additional Microsoft functions were subsequently added
 + * to MSVCRT.DLL, from Windows-Vista onward, and they are prototyped here,
 + * MinGW applications are strenuously encouraged to avoid using them; a
 + * much better alternative is to "#define _XOPEN_SOURCE 700" before any
 + * system header is included, then use POSIX standard printf() functions
 + * instead; this is both portable to many non-Windows platforms, and it
 + * offers better compatibility with earlier Windows versions.
   */
 -int __cdecl __MINGW_NOTHROW snprintf (char *, size_t, const char *, ...);
 -int __cdecl __MINGW_NOTHROW vsnprintf (char *, size_t, const char *, __VALIST);
++#ifndef __have_typedef_locale_t
++/* Note that some of the following require the opaque locale_t data type,
++ * which we may obtain, by selective inclusion, from <locale.h>
++ */
++#define __need_locale_t
++#include <locale.h>
++#endif
 -int __cdecl __MINGW_NOTHROW vscanf (const char * __restrict__, __VALIST);
 -int __cdecl __MINGW_NOTHROW vfscanf (FILE * __restrict__, const char * __restrict__,
 -                   __VALIST);
 -int __cdecl __MINGW_NOTHROW vsscanf (const char * __restrict__,
 -                   const char * __restrict__, __VALIST);
++#ifdef _STDIO_H
++/* The following are to be declared only when <stdio.h> is explicitly
++ * included; the first six are NOT dependent on locale_t...
++ */
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _printf_p (const char *, ...);
  
 -#endif  /* !__NO_ISOCEXT */
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _fprintf_p (FILE *, const char *, ...);
  
 -/*
 - * Formatted Input
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _sprintf_p (char *, size_t, const char *, ...);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vprintf_p (const char *, __VALIST);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vfprintf_p (FILE *, const char *, __VALIST);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vsprintf_p (char *, size_t, const char *, __VALIST);
 +
- #ifndef __have_typedef_locale_t
- /* The following require the opaque locale_t data type, which we
-  * may obtain, by selective inclusion, from <locale.h>
++/* ...whereas the following six DO depend on locale_t.
 + *
 + * CAVEAT: unless you are linking with non-free MSVCR80.DLL, or one
 + * of its later derivatives, good luck trying to use these; see the
 + * explanation in <locale.t>, as to why you may be unable to create,
 + * or otherwise acquire a reference to, a locale_t object.
   */
- #define __need_locale_t
- #include <locale.h>
- #endif
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _printf_p_l (const char *, locale_t, ...);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _fprintf_p_l (FILE *, const char *, locale_t, ...);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _sprintf_p_l (char *, size_t, const char *, locale_t, ...);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vprintf_p_l (const char *, locale_t, __VALIST);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vfprintf_p_l (FILE *, const char *, locale_t, __VALIST);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vsprintf_p_l (char *, size_t, const char *, locale_t, __VALIST);
 +
- #endif        /* MSVCR80.DLL and descendants, or MSVCRT.DLL since Vista */
 +#endif        /* <stdio.h> included in its own right */
++#endif        /* MSVCR80.DLL and descendants, or MSVCRT.DLL since Vista */
 -_CRTIMP int __cdecl __MINGW_NOTHROW   fscanf (FILE*, const char*, ...);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   scanf (const char*, ...);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   sscanf (const char*, const char*, ...);
 +#if ! (defined _STDIO_H && defined _WCHAR_H)
 +#if __MSVCRT_VERSION__ >= __MSVCR80_DLL || _WIN32_WINNT >= _WIN32_WINNT_VISTA
  /*
 - * Character Input and Output Functions
 + * Wide character variants of the foregoing "positional parameter" printf()
 + * functions; MSDN says that these should be declared when either <stdio.h>, or
 + * <wchar.h> is included, so we make them selectively available to <wchar.h>,
 + * but, just as in the foregoing, we advise against their use.
   */
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _wprintf_p (const wchar_t *, ...);
  
 -_CRTIMP int __cdecl __MINGW_NOTHROW   fgetc (FILE*);
 -_CRTIMP char* __cdecl __MINGW_NOTHROW fgets (char*, int, FILE*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   fputc (int, FILE*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   fputs (const char*, FILE*);
 -_CRTIMP char* __cdecl __MINGW_NOTHROW gets (char*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   puts (const char*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   ungetc (int, FILE*);
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _fwprintf_p (FILE *, const wchar_t *, ...);
  
 -/* Traditionally, getc and putc are defined as macros. but the
 -   standard doesn't say that they must be macros.
 -   We use inline functions here to allow the fast versions
 -   to be used in C++ with namespace qualification, eg., ::getc.
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _swprintf_p (wchar_t *, size_t, const wchar_t *, ...);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vwprintf_p (const wchar_t *, __VALIST);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vfwprintf_p (FILE *, const wchar_t *, __VALIST);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vswprintf_p (wchar_t *, size_t, const wchar_t *, __VALIST);
 +
- #ifndef __have_typedef_locale_t
- /* The following also require the locale_t data type, which we may
-  * obtain if necessary, by selective inclusion, from <locale.h>
-  *
-  * CAVEAT: use of these is subject to the same limitations as are
-  * applicable to their "char *" counterparts; (see above).
-  */
- #define __need_locale_t
- #include <locale.h>
- #endif
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _wprintf_p_l (const wchar_t *, locale_t, ...);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _fwprintf_p_l (FILE *, const wchar_t *, locale_t, ...);
  
 -   _filbuf and _flsbuf  are not thread-safe. */
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _filbuf (FILE*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _flsbuf (int, FILE*);
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _swprintf_p_l (wchar_t *, size_t, const wchar_t *, locale_t, ...);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vwprintf_p_l (const wchar_t *, locale_t, __VALIST);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vfwprintf_p_l (FILE *, const wchar_t *, locale_t, __VALIST);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +int _vswprintf_p_l (wchar_t *, size_t, const wchar_t *, locale_t, __VALIST);
 +
 +#endif        /* MSVCR80.DLL and descendants, or MSVCRT.DLL since Vista */
 +#endif        /* ! (defined _STDIO_H && defined _WCHAR_H) */
 +#ifdef _STDIO_H
 +/* Once again, back to <stdio.h> specific declarations.
 + *
 + *
 + * Formatted Input
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    fscanf (FILE *, const char *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    scanf (const char *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    sscanf (const char *, const char *, ...);
 +
 +/* Character Input and Output Functions
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    fgetc (FILE *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  char * fgets (char *, int, FILE *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    fputc (int, FILE *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    fputs (const char *, FILE *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  char * gets (char *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    puts (const char *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    ungetc (int, FILE *);
 +
 +/* Traditionally, getc and putc are defined as macros. but the
 + * standard doesn't say that they must be macros.  We use inline
 + * functions here to allow the fast versions to be used in C++
 + * with namespace qualification, eg., ::getc.
 + *
 + * NOTE: _filbuf and _flsbuf  are not thread-safe.
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW  int   _filbuf (FILE *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int   _flsbuf (int, FILE *);
  
  #if !defined _MT
  
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW getc (FILE*);
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW getc (FILE* __F)
++__CRT_INLINE __cdecl __MINGW_NOTHROW  int getc (FILE *);
 +__CRT_INLINE __cdecl __MINGW_NOTHROW  int getc (FILE * __F)
  {
    return (--__F->_cnt >= 0)
      ?  (int) (unsigned char) *__F->_ptr++
      : _filbuf (__F);
  }
  
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW putc (int, FILE*);
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW putc (int __c, FILE* __F)
++__CRT_INLINE __cdecl __MINGW_NOTHROW  int putc (int, FILE *);
 +__CRT_INLINE __cdecl __MINGW_NOTHROW  int putc (int __c, FILE * __F)
  {
    return (--__F->_cnt >= 0)
      ?  (int) (unsigned char) (*__F->_ptr++ = (char)__c)
      :  _flsbuf (__c, __F);
  }
  
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW getchar (void);
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW getchar (void)
++__CRT_INLINE __cdecl __MINGW_NOTHROW  int getchar (void);
 +__CRT_INLINE __cdecl __MINGW_NOTHROW  int getchar (void)
  {
    return (--stdin->_cnt >= 0)
      ?  (int) (unsigned char) *stdin->_ptr++
      : _filbuf (stdin);
  }
  
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW putchar(int);
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW putchar(int __c)
++__CRT_INLINE __cdecl __MINGW_NOTHROW  int putchar(int);
 +__CRT_INLINE __cdecl __MINGW_NOTHROW  int putchar(int __c)
  {
    return (--stdout->_cnt >= 0)
      ?  (int) (unsigned char) (*stdout->_ptr++ = (char)__c)
@@@ -844,52 -534,56 +854,54 @@@ _CRTIMP __cdecl __MINGW_NOTHROW  in
  #define fileno(__F) ((__F)->_file)
  #endif
  
 -#if defined (__MSVCRT__) && !defined (__NO_MINGW_LFS)
 -#include <sys/types.h>
 -__CRT_INLINE FILE* __cdecl __MINGW_NOTHROW fopen64 (const char*, const char*);
 -__CRT_INLINE FILE* __cdecl __MINGW_NOTHROW fopen64 (const char* filename, const char* mode)
 -{
 -  return fopen (filename, mode);
 -}
 +#if defined (__MSVCRT__) && ! defined (__NO_MINGW_LFS)
- __CRT_INLINE __JMPSTUB__(( FUNCTION = fopen64, REMAPPED = fopen ))
++__CRT_ALIAS FILE * __cdecl __MINGW_NOTHROW  fopen64 (const char *, const char *);
++__CRT_ALIAS __JMPSTUB__(( FUNCTION = fopen64, REMAPPED = fopen ))
 +FILE * __cdecl __MINGW_NOTHROW  fopen64 (const char * filename, const char * mode)
 +{ return fopen (filename, mode); }
  
 -int __cdecl __MINGW_NOTHROW fseeko64 (FILE*, off64_t, int);
 +int __cdecl __MINGW_NOTHROW  fseeko64 (FILE *, __off64_t, int);
  
  #ifdef __USE_MINGW_FSEEK
 -int __cdecl __MINGW_NOTHROW __mingw_fseeko64 (FILE *, off64_t, int);
 +int __cdecl __MINGW_NOTHROW __mingw_fseeko64 (FILE *, __off64_t, int);
  #define fseeko64(fp, offset, whence)  __mingw_fseeko64(fp, offset, whence)
  #endif
  
- __CRT_INLINE __LIBIMPL__(( FUNCTION = ftello64 ))
 -__CRT_INLINE off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE *);
 -__CRT_INLINE off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE * stream)
 -{
 -  fpos_t pos;
 -  if (fgetpos(stream, &pos))
 -    return  -1LL;
 -  else
 -   return ((off64_t) pos);
 -}
 -#endif /* __NO_MINGW_LFS */
 -
 -#endif        /* Not __STRICT_ANSI__ */
 -
 -/* Wide  versions */
 -
 -#ifndef _WSTDIO_DEFINED
 -/*  also in wchar.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   _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   _vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _vscwprintf (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*);
 -
 -/* These differ from the ISO C prototypes, which have a maxlen parameter (like snprintf).  */
++__CRT_ALIAS __off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE *);
++__CRT_ALIAS __LIBIMPL__(( FUNCTION = ftello64 ))
 +__off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE * stream)
 +{ fpos_t __pos; return (fgetpos(stream, &__pos)) ? -1LL : (__off64_t)(__pos); }
 +
 +#endif        /* __MSVCRT__ && !__NO_MINGW_LFS */
 +#endif        /* !__STRICT_ANSI__ */
 +#endif        /* _STDIO_H */
 +
 +#if ! (defined _STDIO_H && defined _WCHAR_H)
 +/* The following are declared when including either <stdio.h> or <wchar.h>.
 + * If both header include guards are now in place, then we must currently be
 + * including <stdio.h> in its own right, having already processed this block
 + * during prior partial inclusion by <wchar.h>; there is no need to process
 + * it a second time.
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW  int     fwprintf (FILE *, const wchar_t *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int     wprintf (const wchar_t *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int     vfwprintf (FILE *, const wchar_t *, __VALIST);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int     vwprintf (const wchar_t *, __VALIST);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    _snwprintf (wchar_t *, size_t, const wchar_t *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    _vscwprintf (const wchar_t *, __VALIST);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int    _vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int     fwscanf (FILE *, const wchar_t *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int     wscanf (const wchar_t *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int     swscanf (const wchar_t *, const wchar_t *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wint_t  fgetwc (FILE *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wint_t  fputwc (wchar_t, FILE *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wint_t  ungetwc (wchar_t, FILE *);
 +
  #ifndef __STRICT_ANSI__
 -_CRTIMP int __cdecl __MINGW_NOTHROW   swprintf (wchar_t*, const wchar_t*, ...);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   vswprintf (wchar_t*, const wchar_t*, __VALIST);
 +/* These differ from the ISO C prototypes, which have a maxlen parameter (like snprintf).
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW  int  swprintf (wchar_t *, const wchar_t *, ...);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int  vswprintf (wchar_t *, const wchar_t *, __VALIST);
  #endif
  
  #ifdef __MSVCRT__
@@@ -312,170 -279,115 +312,207 @@@ __MINGW_IMPORT  char *_pgmptr_dll
  #if !defined (__DECLSPEC_SUPPORTED) || defined (__IN_MINGW_RUNTIME)
  
  #ifdef __MSVCRT__
 -extern int* _imp___fmode;
 -#define       _fmode  (*_imp___fmode)
 +#define _fmode  (*_imp___fmode)
 +extern int *_imp___fmode;
  #else
  /* CRTDLL */
 -extern int* _imp___fmode_dll;
 -#define       _fmode  (*_imp___fmode_dll)
 +#define _fmode  (*_imp___fmode_dll)
 +extern int *_imp___fmode_dll;
  #endif
  
 -#else /* __DECLSPEC_SUPPORTED */
 -
 +#else  /* __DECLSPEC_SUPPORTED */
  #ifdef __MSVCRT__
  __MINGW_IMPORT  int _fmode;
 -#else /* ! __MSVCRT__ */
 +
 +#else  /* ! __MSVCRT__ */
 +#define _fmode        _fmode_dll
  __MINGW_IMPORT  int _fmode_dll;
 -#define       _fmode  _fmode_dll
 -#endif /* ! __MSVCRT__ */
  
 -#endif /* __DECLSPEC_SUPPORTED */
 +#endif  /* !__MSVCRT__ */
 +#endif  /* __DECLSPEC_SUPPORTED */
 +#endif  /* !__STRICT_ANSI__ */
  
 -#endif /* Not __STRICT_ANSI__ */
 +_CRTIMP __cdecl __MINGW_NOTHROW  int atoi (const char *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  long atol (const char *);
  
 -_CRTIMP __int64 __cdecl _strtoi64(const char*, char **, int);
 -_CRTIMP __int64 __cdecl _strtoi64_l(const char *, char **, int, _locale_t);
 -_CRTIMP unsigned __int64 __cdecl _strtoui64(const char*, char **, int);
 -_CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *, char **, int, _locale_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  double strtod (const char *, char **);
 +_CRTIMP __cdecl __MINGW_NOTHROW  double atof (const char *);
  
 -_CRTIMP double __cdecl __MINGW_NOTHROW        atof    (const char*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   atoi    (const char*);
 -_CRTIMP long __cdecl __MINGW_NOTHROW  atol    (const char*);
  #if !defined (__STRICT_ANSI__)
 -_CRTIMP double __cdecl __MINGW_NOTHROW        _wtof (const wchar_t *);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _wtoi (const wchar_t *);
 -_CRTIMP long __cdecl __MINGW_NOTHROW _wtol (const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  double _wtof (const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _wtoi (const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  long _wtol (const wchar_t *);
  #endif
 -#if !defined __NO_ISOCEXT  /*  in libmingwex.a */
 -double __cdecl __MINGW_NOTHROW __strtod (const char*, char**);
 -extern double __cdecl __MINGW_NOTHROW
 -strtod (const char* __restrict__ __nptr, char** __restrict__ __endptr);
 -float __cdecl __MINGW_NOTHROW strtof (const char * __restrict__, char ** __restrict__);
 -long double __cdecl __MINGW_NOTHROW strtold (const char * __restrict__, char ** __restrict__);
 -#else
 -_CRTIMP double __cdecl __MINGW_NOTHROW        strtod  (const char*, char**);
 -#endif /* __NO_ISOCEXT */
 -
 -_CRTIMP long __cdecl __MINGW_NOTHROW  strtol  (const char*, char**, int);
 -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW strtoul (const char*, char**, int);
 -
 -#ifndef _WSTDLIB_DEFINED
 -/*  also declared in wchar.h */
 -_CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *, wchar_t **, int);
 -_CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *, wchar_t **, int, _locale_t);
 -_CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *, wchar_t **, int);
 -_CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *, wchar_t **, int, _locale_t);
 -_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 */
 +
 +#if __USE_MINGW_ANSI_STDIO
 +/* Microsoft's strtod() and atof() implementations, (in MSVCRT.DLL),
 + * mishandle infinities and NaNs; on the basis that this conditional
 + * exposes a more ISO-C conforming printf() I/O family implementaion,
 + * we substitute a similarly more conforming implementation for each
 + * of this pair of (somewhat related) functions.
 + *
 + * Note that we provide neither __JMPSTUB__ nor __LIBIMPL__ external
 + * equivalents for either of these two inline functions, because they
 + * would conflict with the runtime DLL implementations; users needing
 + * an address reference for either must provide an equivalent of the
 + * inline implementation, as non-inlined within their own code.
 + */
 +extern __cdecl __MINGW_NOTHROW
 +double __strtod (const char *__restrict__, char **__restrict__);
 +
 +__CRT_ALIAS __cdecl __MINGW_NOTHROW
 +double strtod (const char *__restrict__ __nptr, char **__restrict__ __endptr)
 +{ return __strtod( __nptr, __endptr ); }
 +
 +__CRT_ALIAS __cdecl __MINGW_NOTHROW
 +double atof (const char *__nptr) { return __strtod( __nptr, NULL ); }
 +
 +#endif  /* __USE_MINGW_ANSI_STDIO */
 +
 +#ifdef _ISOC99_SOURCE
 +/* Irrespective of requested standards conformity, where MSVCRT.DLL
 + * falls short, ISO-C99 offers this pair of alternative return type
 + * specific variants of strtod(), which MSVCRT.DLL does not, but we
 + * do, in libmingwex.a:
 + */
 +__cdecl __MINGW_NOTHROW
 +float strtof (const char *__restrict__, char **__restrict__);
 +
 +__cdecl __MINGW_NOTHROW
 +long double strtold (const char *__restrict__, char **__restrict__);
 +#endif  /* _ISOC99_SOURCE */
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW  long strtol (const char *, char **, int);
 +_CRTIMP __cdecl __MINGW_NOTHROW  unsigned long strtoul (const char *, char **, int);
 +
 +#endif        /* _STDLIB_H only */
 +#if ! (defined _STDLIB_H && defined _WCHAR_H)
 +/* Prototypes which are to be declared both here, in <stdlib.h>,
 + * and also in <wchar.h>; declare them here, such that they may be
 + * selectively included by <wchar.h>.
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +long wcstol (const wchar_t *, wchar_t **, int);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +unsigned long wcstoul (const wchar_t *, wchar_t **, int);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW  double wcstod (const wchar_t *, wchar_t **);
 +
 +#ifdef _ISOC99_SOURCE
 +/* Variants on wcstod(), specified by ISO-C99; once again, MSVCRT.DLL
 + * doesn't have them, but we offer them in libmingwex.a
 + */
 +__cdecl __MINGW_NOTHROW
 +float wcstof (const wchar_t *__restrict__, wchar_t **__restrict__);
 +
 +__cdecl __MINGW_NOTHROW
 +long double wcstold (const wchar_t *__restrict__, wchar_t **__restrict__);
 +#endif  /* _ISOC99_SOURCE */
 +
  #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
++#if __MSVCRT_VERSION__ >= __MSVCR70_DLL || _WIN32_WINNT >= _WIN32_WINNT_WINXP
++/* This pair of wide character equivalents for ISO-C99's strtoll() and
++ * strtoull() require either WinXP (or later), or a non-free MSVC runtime
++ * from MSVCR70.DLL onwards...
++ */
++_CRTIMP __cdecl __MINGW_NOTHROW
++__int64 _wcstoi64(const wchar_t *, wchar_t **, int);
 -_CRTIMP size_t __cdecl __MINGW_NOTHROW        wcstombs        (char*, const wchar_t*, size_t);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   wctomb          (char*, wchar_t);
++_CRTIMP __cdecl __MINGW_NOTHROW
++unsigned __int64 _wcstoui64(const wchar_t *, wchar_t **, int);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   mblen           (const char*, size_t);
 -_CRTIMP size_t __cdecl __MINGW_NOTHROW        mbstowcs        (wchar_t*, const char*, size_t);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   mbtowc          (wchar_t*, const char*, size_t);
++#endif        /* WinXP || MSVCR70.DLL || later */
 -_CRTIMP int __cdecl __MINGW_NOTHROW   rand    (void);
 -_CRTIMP void __cdecl __MINGW_NOTHROW  srand   (unsigned int);
++#if __MSVCRT_VERSION__ >= __MSVCR80_DLL || _WIN32_WINNT >= _WIN32_WINNT_VISTA
++/* ...while the following pair require Win-Vista (or later), or non-free
++ * MSVCRT runtime from MSVCR80.DLL onwards; they also require...
++ */
++#ifndef __have_typedef_locale_t
++/* ...this opaque data type, which we may obtain by selective inclusion
++ * from <locale.h>.  (Note that this may render them unusable for users of
++ * MSVCRT.DLL; see the explanation in <locale.h>, regarding the difficulty
++ * in creating, or otherwise acquiring a reference to, a _locale_t object,
++ * notwithstanding the availability of the functions in MSVCRT.DLL, from
++ * the release of Win-Vista onwards).
++ */
++#define __need_locale_t
++#include <locale.h>
++#endif        /* !__have_typedef_locale_t */
 -_CRTIMP void* __cdecl __MINGW_NOTHROW calloc  (size_t, size_t) __MINGW_ATTRIB_MALLOC;
 -_CRTIMP void* __cdecl __MINGW_NOTHROW malloc  (size_t) __MINGW_ATTRIB_MALLOC;
 -_CRTIMP void* __cdecl __MINGW_NOTHROW realloc (void*, size_t);
 -_CRTIMP void __cdecl __MINGW_NOTHROW  free    (void*);
 -_CRTIMP void __cdecl __MINGW_NOTHROW  abort   (void) __MINGW_ATTRIB_NORETURN;
 -_CRTIMP void __cdecl __MINGW_NOTHROW  exit    (int) __MINGW_ATTRIB_NORETURN;
++_CRTIMP __cdecl __MINGW_NOTHROW
++__int64 _wcstoi64_l(const wchar_t *, wchar_t **, int, _locale_t);
 -/* Note: This is in startup code, not imported directly from dll */
 -int __cdecl __MINGW_NOTHROW   atexit  (void (*)(void));
++_CRTIMP __cdecl __MINGW_NOTHROW
++unsigned __int64 _wcstoui64_l(const wchar_t *, wchar_t **, int, _locale_t);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   system  (const char*);
 -_CRTIMP char* __cdecl __MINGW_NOTHROW getenv  (const char*);
++#endif        /* Win-Vista || MSVCR80.DLL || later */
 -/* bsearch and qsort are also in non-ANSI header search.h  */
 -_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t,
 -                             int (*)(const void*, const void*));
 -_CRTIMP void __cdecl qsort(void*, size_t, size_t,
 -                         int (*)(const void*, const void*));
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wgetenv (const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _wputenv (const wchar_t *);
  
 -_CRTIMP int __cdecl __MINGW_NOTHROW   abs     (int) __MINGW_ATTRIB_CONST;
 -_CRTIMP long __cdecl __MINGW_NOTHROW  labs    (long) __MINGW_ATTRIB_CONST;
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +void _wsearchenv (const wchar_t *, const wchar_t *, wchar_t *);
  
 -/*
 - * div_t and ldiv_t are structures used to return the results of div and
 - * ldiv.
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _wsystem (const wchar_t *);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +void _wmakepath (wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *,
 +    const wchar_t *
 +  );
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +void _wsplitpath (const wchar_t *, wchar_t *, wchar_t *, wchar_t *, wchar_t *);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW
 +wchar_t *_wfullpath (wchar_t *, const wchar_t *, size_t);
 +
 +#endif        /* __MSVCRT__ */
 +#endif        /* _STDLIB_H || _WCHAR_H */
 +
 +#ifdef _STDLIB_H  /* <stdlib.h> only */
 +_CRTIMP __cdecl __MINGW_NOTHROW  size_t wcstombs (char *, const wchar_t *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int wctomb (char *, wchar_t);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW  int mblen (const char *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  size_t mbstowcs (wchar_t *, const char *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int mbtowc (wchar_t *, const char *, size_t);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW  int rand (void);
 +_CRTIMP __cdecl __MINGW_NOTHROW  void srand (unsigned int);
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW  void *calloc (size_t, size_t) __MINGW_ATTRIB_MALLOC;
 +_CRTIMP __cdecl __MINGW_NOTHROW  void *malloc (size_t) __MINGW_ATTRIB_MALLOC;
 +_CRTIMP __cdecl __MINGW_NOTHROW  void *realloc (void *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  void free (void *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  void abort (void) __MINGW_ATTRIB_NORETURN;
 +_CRTIMP __cdecl __MINGW_NOTHROW  void exit (int) __MINGW_ATTRIB_NORETURN;
 +
 +/* Note: this is in startup code, not imported directly from the runtime DLL
 + */
 +int __cdecl __MINGW_NOTHROW atexit (void (*)(void));
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW  int system (const char *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  char *getenv (const char *);
 +
 +/* bsearch() and qsort() are declared both here, in <stdlib.h>, and in
 + * non-ANSI header <search.h>; we reproduce these declarations in both,
 + * with no attempt to guard them, so the compiler may verify that they
 + * are consistent, if both headers are included.
 + */
 +_CRTIMP __cdecl  void *bsearch
 +(const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
 +
 +_CRTIMP __cdecl  void qsort
 +(void *, size_t, size_t, int (*)(const void *, const void *));
 +
 +_CRTIMP __cdecl __MINGW_NOTHROW  int abs (int) __MINGW_ATTRIB_CONST;
 +_CRTIMP __cdecl __MINGW_NOTHROW  long labs (long) __MINGW_ATTRIB_CONST;
 +
 +/* div_t and ldiv_t are structures used to return the results of div()
 + * and ldiv() functions.
   *
 - * NOTE: div and ldiv appear not to work correctly unless
 + * NOTE: div() and ldiv() appear not to work correctly unless
   *       -fno-pcc-struct-return is specified. This is included in the
   *       mingw32 specs file.
   */
@@@ -604,154 -510,55 +641,179 @@@ __cdecl __MINGW_NOTHROW  void _Exit( in
  #endif
  
  typedef struct { long long quot, rem; } lldiv_t;
 +__cdecl __MINGW_NOTHROW  lldiv_t lldiv (long long, long long) __MINGW_ATTRIB_CONST;
  
 -lldiv_t       __cdecl __MINGW_NOTHROW lldiv (long long, long long) __MINGW_ATTRIB_CONST;
 +__cdecl __MINGW_NOTHROW  long long llabs (long long);
  
 -long long __cdecl __MINGW_NOTHROW llabs(long long);
  #ifndef __NO_INLINE__
 -__CRT_INLINE long long __cdecl __MINGW_NOTHROW llabs(long long _j)
 -  {return (_j >= 0 ? _j : -_j);}
 +__CRT_INLINE
 +/* No JMPSTUB or LIBIMPL reference here -- we provide a free-standing
 + * implementation, along with imaxabs(), in mingwex/imaxabs.c
 + */
 +__cdecl __MINGW_NOTHROW  long long llabs( long long __j )
 +{ return __j >= 0 ? __j : -__j; }
  #endif
  
 -long long  __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int);
 -unsigned long long  __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int);
 +__cdecl __MINGW_NOTHROW
 +long long strtoll (const char *__restrict__, char **__restrict, int);
  
 -#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
 -long long  __cdecl __MINGW_NOTHROW atoll (const char *);
 +__cdecl __MINGW_NOTHROW
 +unsigned long long strtoull (const char *__restrict__, char **__restrict__, int);
  
 -#if !defined (__STRICT_ANSI__)
 -long long  __cdecl __MINGW_NOTHROW wtoll (const wchar_t *);
 -char* __cdecl __MINGW_NOTHROW lltoa (long long, char *, int);
 -char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long , char *, int);
 -wchar_t* __cdecl __MINGW_NOTHROW lltow (long long, wchar_t *, int);
 -wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long, wchar_t *, int);
 +#ifdef __MSVCRT__
 +/* MSVCRT.DLL does not provide ISO-C99's atoll() function, but it does
 + * provide an analogue, in _atoi64(); map it accordingly.
 + */
 +__cdecl __MINGW_NOTHROW  long long atoll (const char *);
  
 -  /* inline using non-ansi functions */
  #ifndef __NO_INLINE__
 -__CRT_INLINE long long  __cdecl __MINGW_NOTHROW atoll (const char * _c)
 -      { return _atoi64 (_c); }
 -__CRT_INLINE char*  __cdecl __MINGW_NOTHROW lltoa (long long _n, char * _c, int _i)
 -      { return _i64toa (_n, _c, _i); }
 -__CRT_INLINE char*  __cdecl __MINGW_NOTHROW ulltoa (unsigned long long _n, char * _c, int _i)
 -      { return _ui64toa (_n, _c, _i); }
 -__CRT_INLINE long long  __cdecl __MINGW_NOTHROW wtoll (const wchar_t * _w)
 -      { return _wtoi64 (_w); }
 -__CRT_INLINE wchar_t*  __cdecl __MINGW_NOTHROW lltow (long long _n, wchar_t * _w, int _i)
 -      { return _i64tow (_n, _w, _i); }
 -__CRT_INLINE wchar_t*  __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, int _i)
 -      { return _ui64tow (_n, _w, _i); }
 -#endif /* (__NO_INLINE__) */
 -#endif /* (__STRICT_ANSI__)  */
 -
 -#endif /* __MSVCRT__ */
 -
 -#endif /* !__NO_ISOCEXT */
 -
 -
 -#ifdef __cplusplus
 -}
 +__CRT_INLINE __JMPSTUB__(( FUNCTION = atoll, REMAPPED = _atoi64 ))
 +__cdecl __MINGW_NOTHROW  long long atoll (const char * _c){ return _atoi64 (_c); }
  #endif
  
 -#endif        /* Not RC_INVOKED */
 +#endif  /* __MSVCRT__ */
 +#endif  /* _ISOC99_SOURCE */
 +
 +#if defined __MSVCRT__ && ! defined __STRICT_ANSI__
++#if __MSVCRT_VERSION__ >= __MSVCR70_DLL || _WIN32_WINNT >= _WIN32_WINNT_WINXP
++/* Microsoft specific alternatives to ISO-C99 strtoll() and strtoull(); the
++ * first pair require WinXP (or later) or non-free MSVCR70.DLL onwards...
++ */
++_CRTIMP __cdecl __MINGW_NOTHROW
++__int64 _strtoi64(const char*, char **, int);
++
++_CRTIMP __cdecl __MINGW_NOTHROW
++unsigned __int64 _strtoui64(const char*, char **, int);
++
++#endif        /* WinXP || MSVCR70.DLL || later */
++#if __MSVCRT_VERSION__ >= __MSVCR80_DLL || _WIN32_WINNT >= _WIN32_WINNT_VISTA
++/* ...while the following pair require Win-Vista (or later), or non-free
++ * MSVCR80.DLL onwards; (note that, like their wide character counterparts,
++ * they may actually be unusable without MSVCR80.DLL onwards, because of
++ * the difficulty in acquiring a reference to a _locale_t object).
++ */
++_CRTIMP __cdecl __MINGW_NOTHROW
++__int64 _strtoi64_l(const char *, char **, int, _locale_t);
++
++_CRTIMP __cdecl __MINGW_NOTHROW
++unsigned __int64 _strtoui64_l(const char *, char **, int, _locale_t);
++
++#endif        /* Win-Vista || MSVCR80.DLL || later */
++
 +/* Type long long analogues for MSVCRT.DLL specific type long functions;
 + * none are actually provided by any version of MSVCRT.DLL, with names as
 + * specified here, but rather as called by the inline functions used to
 + * implement them, (i.e. the REMAPPED name specified in each__JMPSTUB__
 + * function reference respectively).
 + *
 + * FIXME: Not one of these is specified by ISO-C99, nor by POSIX, either;
 + * is there really any justification for us to specify them at all?  For
 + * the time being, declare as deprecated; perhaps remove later?
 + */
 +__cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED  long long wtoll (const wchar_t *);
 +__cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED  char *lltoa (long long, char *, int);
 +__cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED  char *ulltoa (unsigned long long , char *, int);
 +__cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED  wchar_t *lltow (long long, wchar_t *, int);
 +__cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED  wchar_t *ulltow (unsigned long long, wchar_t *, int);
 +
 +#ifndef __NO_INLINE__
 +/* None of these functions would exist at all, without either these inline
 + * implementations, or their respective __JMPSTUB__ equivalents.
 + */
 +__CRT_INLINE __JMPSTUB__(( FUNCTION = lltoa, REMAPPED = _i64toa ))
 +__cdecl __MINGW_NOTHROW  char *lltoa (long long __n, char * __c, int __i)
 +{ return _i64toa (__n, __c, __i); }
 +
 +__CRT_INLINE __JMPSTUB__(( FUNCTION = ulltoa, REMAPPED = _ui64toa ))
 +__cdecl __MINGW_NOTHROW  char *ulltoa (unsigned long long __n, char * __c, int __i)
 +{ return _ui64toa (__n, __c, __i); }
 +
 +__CRT_INLINE __JMPSTUB__(( FUNCTION = wtoll, REMAPPED = _wtoi64 ))
 +__cdecl __MINGW_NOTHROW  long long wtoll (const wchar_t * __w){ return _wtoi64 (__w); }
 +
 +__CRT_INLINE __JMPSTUB__(( FUNCTION = lltow, REMAPPED = _i64tow ))
 +__cdecl __MINGW_NOTHROW  wchar_t *lltow (long long __n, wchar_t * __w, int __i)
 +{ return _i64tow (__n, __w, __i); }
 +
 +__CRT_INLINE __JMPSTUB__(( FUNCTION = ulltow, REMAPPED = _ui64tow ))
 +__cdecl __MINGW_NOTHROW  wchar_t *ulltow (unsigned long long __n, wchar_t * __w, int __i)
 +{ return _ui64tow (__n, __w, __i); }
 +
 +#endif  /* ! __NO_INLINE__ */
 +#endif  /* __MSVCRT__ && ! __STRICT_ANSI__ */
 +
 +/* POSIX/BSD extensions in libmingwex.a; these should be exposed only on
 + * the basis of appropriate POSIX or BSD specific feature tests...
 + *
 + * mkstemp(3) function support; added per feature request #2003.
 + * POSIX wants _XOPEN_SOURCE >= 500, (implying _POSIX_C_SOURCE >= 200112L).
 + */
 +#if _POSIX_C_SOURCE >= 200112L
 +
 +__cdecl __MINGW_NOTHROW  int mkstemp (char *);
 +__cdecl __MINGW_NOTHROW  int __mingw_mkstemp (int, char *);
 +
 +/* On POSIX platforms, programmers may adopt an idiom such as:
 + *
 + *   if( mkstemp( template ) >= 0 )
 + *   { unlink( template );
 + *     . . .
 + *   }
 + *
 + * to ensure that a temporary file does NOT persist after it is
 + * closed; MS-Windows does not allow such use of unlink(2), while
 + * the file remains open.  Thus, MS-Windows programmers must take
 + * extra care, to close and unlink temporary files AFTER use, if
 + * similar behaviour is desired.
 + *
 + * To mitigate this MS-Windows limitation, we provide support for
 + * an alternative, MinGW specific idiom:
 + *
 + *   #include <fcntl.h>
 + *
 + *   _MKSTEMP_SETMODE( _O_TEMPORARY );
 + *   if( mkstemp( template ) >= 0 )
 + *   {
 + *     . . .
 + *   }
 + *
 + * to achieve a similar effect to that of the above POSIX idiom; the
 + * following macros are a MinGW specific extension, to facilite such
 + * use of _O_TEMPORARY, (in addition to the POSIX required attributes),
 + * when creating the temporary file.  Note that they require <fcntl.h>,
 + * which <stdlib.h> should NOT automatically include; we leave it to
 + * the user to explicitly include it, if using _MKSTEMP_SETMODE.
 + */
 +#define _MKSTEMP_INVOKE       0
 +#define _MKSTEMP_DEFAULT     _O_CREAT | _O_EXCL | _O_RDWR
 +#define _MKSTEMP_SETMODE(M) __mingw_mkstemp( _MKSTEMP_DEFAULT | (M), NULL )
 +
 +#ifndef _NO_OLDNAMES
 +#define MKSTEMP_SETMODE(M)  __mingw_mkstemp( _MKSTEMP_DEFAULT | (M), NULL )
 +#endif
 +
 +__CRT_ALIAS __LIBIMPL__(( FUNCTION = mkstemp ))
 +__cdecl __MINGW_NOTHROW  int mkstemp (char *__filename_template)
 +{ return __mingw_mkstemp( _MKSTEMP_INVOKE, __filename_template ); }
 +
 +#endif        /* _POSIX_C_SOURCE >= 200112L (for mkstemp()) */
 +
 +/* mkdtemp(3) function support: added as adjunct to feature request #2003.
 + * POSIX wants _XOPEN_SOURCE >= 700, (implying _POSIX_C_SOURCE >= 200809L).
 + */
 +#if _POSIX_C_SOURCE >= 200809L
 +
 +__cdecl __MINGW_NOTHROW  char *mkdtemp (char *);
 +__cdecl __MINGW_NOTHROW  char *__mingw_mkdtemp (char *);
 +
 +__CRT_ALIAS __JMPSTUB__(( FUNCTION = mkdtemp ))
 +__cdecl __MINGW_NOTHROW  char *mkdtemp (char *__dirname_template)
 +{ return __mingw_mkdtemp( __dirname_template ); }
 +
 +#endif        /* _POSIX_C_SOURCE >= 200809L (for mkdtemp()) */
 +#endif        /* _STDLIB_H */
  
 -#endif        /* Not _STDLIB_H_ */
 +_END_C_DECLS
  
 +#endif        /* ! RC_INVOKED */
 +#endif        /* ! _STDLIB_H: $RCSfile$: end of file */
  #define WCHAR_MIN     0
  #define WCHAR_MAX     0xffff
  
 -#ifndef WEOF
 -#define       WEOF    (wchar_t)(0xFFFF)
 -#endif
 +#define WEOF          (wchar_t)(0xffff)
  
  #ifndef RC_INVOKED
 +#define __WCHAR_H_SOURCED__
 +/* ISO-C, POSIX, and Microsoft specify an overlap of content between
 + * <wchar.h> and other system header files; by inclusion of such other
 + * headers within this "__WCHAR_H_SOURCED__" scope, we may selectively
 + * retrieve the overlapping content, without requiring duplication of
 + * that content here; thus, from...
 + */
 +#include "stdio.h"
 +/* ...we obtain (possibly indirect) definitions and declarations for:
 + *
 + *  macros  NULL, FILENAME_MAX
 + *  types   size_t, wchar_t, wint_t, va_list (a.k.a. __VALIST), FILE
 + *  types   ssize_t, off_t, __off64_t, (conditionally, as needed)
 + *
 + *  int     fwprintf (FILE *, const wchar_t *, ...);
 + *  int     wprintf (const wchar_t *, ...);
 + *  int     vfwprintf (FILE *, const wchar_t *, __VALIST);
 + *  int     vwprintf (const wchar_t *, __VALIST);
 + *  int     snwprintf (wchar_t *, size_t, const wchar_t *, ...);
 + *  int    _snwprintf (wchar_t *, size_t, const wchar_t *, ...);
 + *  int    _vscwprintf (const wchar_t *, __VALIST);
 + *  int    _vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST);
 + *  int     vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST);
 + *  int     fwscanf (FILE *, const wchar_t *, ...);
 + *  int     wscanf (const wchar_t *, ...);
 + *  int     swscanf (const wchar_t *, const wchar_t *, ...);
 + *  int     vwscanf (const wchar_t *, __VALIST);
 + *  int     vfwscanf (FILE *, const wchar_t *, __VALIST);
 + *  int     vswscanf (const wchar_t *, const wchar_t *, __VALIST);
 + *  wint_t  fgetwc (FILE *);
 + *  wint_t  fputwc (wchar_t, FILE *);
 + *  wint_t  ungetwc (wchar_t, FILE *);
 + *
 + * The following pair of Microsoft functions conflict with their
 + * corresponding ISO-C prototypes; consequently they will not be
 + * declared when "__STRICT_ANSI__" checking is in effect:
 + *
 + *  int  swprintf (wchar_t *, const wchar_t *, ...);
 + *  int  vswprintf (wchar_t *, const wchar_t *, __VALIST);
 + *
 + * The following group of functions is specified by ISO-C, but
 + * their Microsoft implementations are available only if use of
 + * "__MSVCRT__" is specified:
 + *
 + *  wchar_t * fgetws (wchar_t *, int, FILE *);
 + *  int       fputws (const wchar_t *, FILE *);
 + *  wint_t    getwc (FILE *);
 + *  wint_t    getwchar (void);
 + *  wint_t    putwc (wint_t, FILE *);
 + *  wint_t    putwchar (wint_t);
 + *
 + * The following group of functions is also dependent on use of
 + * "__MSVCRT__"; however, these are Microsoft specific, so they
 + * are not declared if "__STRICT_ANSI__" checking is specified:
 + *
 + *  wchar_t * _getws (wchar_t *);
 + *  int       _putws (const wchar_t *);
 + *  FILE    * _wfdopen (int, const wchar_t *);
 + *  FILE    * _wfopen (const wchar_t *, const wchar_t *);
 + *  FILE    * _wfreopen (const wchar_t *, const wchar_t *, FILE *);
 + *  FILE    * _wfsopen (const wchar_t *, const wchar_t *, int);
 + *  wchar_t * _wtmpnam (wchar_t *);
 + *  wchar_t * _wtempnam (const wchar_t *, const wchar_t *);
 + *  int       _wrename (const wchar_t *, const wchar_t *);
 + *  int       _wremove (const wchar_t *);
 + *  void      _wperror (const wchar_t *);
 + *  FILE    * _wpopen (const wchar_t *, const wchar_t *);
 + *
 + *
 + * In similar fashion, from...
 + */
 +#include "stdlib.h"
 +/* ...we obtain prototypes for universally supported functions:
 + *
 + *  long wcstol (const wchar_t *, wchar_t **, int);
 + *  unsigned long wcstoul (const wchar_t *, wchar_t **, int);
 + *  double wcstod (const wchar_t *, wchar_t **);
 + *
 + * The following are Microsoft specific, and require MSCVRT.DLL,
 + * or any of its non-free derivatives; they are not available to
 + * applications which use CRTDLL.DLL:
 + *
 + *  wchar_t *_wgetenv (const wchar_t *);
 + *  int _wputenv (const wchar_t *);
 + *  void _wsearchenv (const wchar_t *, const wchar_t *, wchar_t *);
 + *  int _wsystem (const wchar_t *);
 + *  void _wmakepath (wchar_t *, const wchar_t *, const wchar_t *,
 + *          const wchar_t *, const wchar_t *
 + *        );
 + *  void _wsplitpath (const wchar_t *, wchar_t *, wchar_t *,
 + *          wchar_t *, wchar_t *
 + *        );
 + *  wchar_t *_wfullpath (wchar_t *, const wchar_t *, size_t);
 + *
++ * ...with this pair requiring either WinXP (or later), or one of
++ * the non-free MSVC runtimes from MSVCR70.DLL onwards:
++ *
++ *  __int64 _wcstoi64 (const wchar_t *, wchar_t **, int);
++ *  unsigned __int64 _wcstoui64 (const wchar_t *, wchar_t **, int);
++ *
++ *  ...and this pair requiring Win-Vista (or later), or a non-free
++ *  MSVC runtime from MSVCR80.DLL onwards:
++ *
++ *  __int64 _wcstoi64_l (const wchar_t *, wchar_t **, int, _locale_t);
++ *  unsigned __int64 _wcstoui64_l (const wchar_t *, wchar_t **,
++ *          int, _locale_t);
++ *        );
++ *
 + * ...while this pair are ISO-C99 standards, which are available
 + * in libmingwex.a, but not in any version of MSVCRT.DLL, (nor in
 + * any of its non-free derivatives prior to MSVCR120.DLL), nor in
 + * CRTDLL.DLL:
 + *
 + *  float wcstof (const wchar_t *restrict, wchar_t **restrict);
 + *  long double wcstold (const wchar_t *restrict, wchar_t **restrict);
 + *
 + *
 + * while from...
 + */
 +#include "direct.h"
 +/* ...we obtain prototypes for each of the following functions,
 + * (none of which are available when using CRTDLL.DLL):
 + *
 + *  int _wchdir (const wchar_t *);
 + *  wchar_t *_wgetcwd (wchar_t *, int);
 + *  wchar_t *_wgetdcwd (int, wchar_t *, int);
 + *  int _wmkdir (const wchar_t *);
 + *  int _wrmdir (const wchar_t *);
 + *
 + *
 + * From...
 + */
 +#include "sys/stat.h"
 +/* ...we obtain function prototypes, and all associated data type
 + * definitions for this pair of actual functions, in all versions of
 + * MSVCRT.DLL, and its non-free derivatives preceding MSVCR80.DLL, (or
 + * inline replacement implementations for MSVCR80.DLL and later):
 + *
 + *  int _wstat (const wchar_t *, struct _stat *);
 + *  int _wstati64 (const wchar_t *, struct _stati64 *);
 + *
 + * ...this additional actual function, available in MSVCRT.DLL from
 + * Win2K onwards, or in non-free MSVCR61.DLL and again requiring an
 + * inline replacement from MSVCR80.DLL onwards:
 + *
 + *  int _wstat64 (const wchar_t *, struct __stat64 *);
 + *
 + * ...and these actual functions, which are available only in non-free
 + * MSVCR80.DLL, and its later derivatives:
 + *
 + *  int _wstat32 (const wchar_t *, struct __stat32 *);
 + *  int _wstat32i64 (const wchar_t *, struct _stat32i64 *);
 + *  int _wstat64i32 (const wchar_t *, struct _stat64i32 *);
 + *
 + *
 + * while from...
 + */
 +#include "io.h"
 +/* ...we obtain function prototypes for each of the following, which
 + * are available in all versions of MSVCRT.DLL, (and all its non-free
 + * derivatives), but are not supported by CRTDLL.DLL:
 + *
 + *  int _waccess (const wchar_t *, int);
 + *  int _wchmod (const wchar_t *, int);
 + *  int _wcreat (const wchar_t *, int);
 + *  int _wopen (const wchar_t *, int, ...);
 + *  int _wsopen (const wchar_t *, int, int, ...);
 + *  int _wunlink (const wchar_t *);
 + *  wchar_t *_wmktemp (wchar_t *);
 + *
 + * ...and also function prototypes and definitions of all associated
 + * data types and manifest constants for the following, each of which
 + * is physically implemented in all versions of MSVCRT.DLL, and in each
 + * of its non-free variants prior to MSVCR80.DLL, or emulated by inline
 + * replacement functions for MSVCR80.DLL and later:
 + *
 + *  intptr_t _wfindfirst (wchar_t *, struct _wfinddata_t *);
 + *  int _wfindnext (intptr_t, struct _wfinddata_t *);
 + *
 + *  intptr_t _wfindfirsti64 (wchar_t *, struct _wfinddatai64_t *);
 + *  int _wfindnexti64 (intptr_t, struct _wfinddatai64_t *);
 + *
 + * ...this additional pair of functions, available in all versions of
 + * MSVCRT.DLL from Win2K, and non-free variants from MSVCR61.DLL:
 + *
 + *  intptr_t _wfindfirst64 (wchar_t *, struct __wfinddata64_t *);
 + *  int _wfindnext64 (intptr_t, struct __wfinddata64_t *);
 + *
 + * ...and these, which are only available in the non-free run-times
 + * from MSVCR80.DLL onwards:
 + *
 + *  intptr_t _wfindfirst32 (wchar_t *, struct __wfinddata32_t *);
 + *  int _wfindnext32 (intptr_t, struct __wfinddata32_t *);
 + *
 + *  intptr_t _wfindfirst32i64 (wchar_t *, struct _wfinddata32i64_t *);
 + *  int _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t *);
 + *
 + *  intptr_t _wfindfirst64i32 (wchar_t *, struct _wfinddata64i32_t *);
 + *  int _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t *);
 + *
 + * Additionally, although Microsoft's <wchar.h> may not declare it,
 + * this is required to complement all variants of the _wfindfirst()
 + * and _wfindnext() API, so we also declare the prototype for:
 + *
 + *  int _findclose (intptr_t);
 + *
 + *
 + * and from...
 + */
 +#include "time.h"
 +/* ...we obtain an opaque forward declaration of:
 + *
 + *  struct tm
 + *
 + * ...and prototype declarations for the following ISO-C99 function,
 + * (which is always provided):
 + *
 + *  size_t wcsftime (wchar_t *, size_t, const wchar_t *, const struct tm *);
 + *
 + * ...together with the following non-ISO-C functions, (which are
 + * NOT exposed when "__STRICT_ANSI__" checking is enabled):
 + *
 + *  wchar_t *_wctime (const time_t *);
 + *  wchar_t *_wasctime (const struct tm *);
 + *  wchar_t *_wstrdate (wchar_t *);
 + *  wchar_t *_wstrtime (wchar_t *);
 + *
 + * Of the preceding group, we also note that, while it remains in
 + * all versions of MSVCRT.DLL, (using a strictly 32-bit data type
 + * to represent its "time_t" argument), the _wctime() function is
 + * NOT present in MSVCR80.DLL, and later versions of the non-free
 + * MSVC runtime libraries, in which it is replaced by either of:
 + *
 + *  wchar_t *_wctime64 (const __time64_t *);
 + *  wchar_t *_wctime32 (const __time32_t *);
 + *
 + * ...with the actual replacement being chosen at compile time, on
 + * the basis of the user specified "_USE_32BIT_TIME_T" feature test
 + * macro, (a Microsoft specific, brain damaged concept), which maps
 + * _wctime() itself, as an in-line alias for its corresponding
 + * replacement library function.
 + *
 + *
 + * Also, from...
 + */
 +#include "locale.h"
 +/* ...we obtain the declaration for:
 + *
 + *   wchar_t *_wsetlocale (int, const wchar_t *);
 + *
 + *
 + * and from...
 + */
 +#include "process.h"
 +/* ...we obtain function prototypes for:
 + *
 + *  intptr_t _wexecl (const wchar_t *, const wchar_t *, ...);
 + *  intptr_t _wexecle (const wchar_t *, const wchar_t *, ...);
 + *  intptr_t _wexeclp (const wchar_t *, const wchar_t *, ...);
 + *  intptr_t _wexeclpe (const wchar_t *, const wchar_t *, ...);
 + *
 + *  intptr_t _wexecv (const wchar_t *, const wchar_t * const *);
 + *  intptr_t _wexecve (
 + *    const wchar_t *, const wchar_t * const *, const wchar_t * const *
 + *   );
 + *  intptr_t _wexecvp (const wchar_t *, const wchar_t * const *);
 + *  intptr_t _wexecvpe (
 + *    const wchar_t *, const wchar_t * const *, const wchar_t * const *
 + *   );
 + *
 + *  intptr_t _wspawnl (int, const wchar_t *, const wchar_t *, ...);
 + *  intptr_t _wspawnle (int, const wchar_t *, const wchar_t *, ...);
 + *  intptr_t _wspawnlp (int, const wchar_t *, const wchar_t *, ...);
 + *  intptr_t _wspawnlpe (int, const wchar_t *, const wchar_t *, ...);
 + *
 + *  intptr_t _wspawnv (int, const wchar_t *, const wchar_t * const *);
 + *  intptr_t _wspawnve (
 + *    int, const wchar_t *, const wchar_t * const *, const wchar_t * const *
 + *   );
 + *  intptr_t _wspawnvp (int, const wchar_t *, const wchar_t * const *);
 + *  intptr_t _wspawnvpe (
 + *    int, const wchar_t *, const wchar_t * const *, const wchar_t * const *
 + *   );
 + *
 + */
 +_BEGIN_C_DECLS
 +
 +/* Wide character string functions must be specified here, as required
 + * by the ISO-C Standard; however, MSVC contravenes this standard by also
 + * requiring them to appear in <string.h>.  We declare them here, where
 + * they rightfully belong, but we also arrange for them to be available
 + * for selective inclusion by <string.h>; to facilitate this, we must
 + * change the declarative condition...
 + */
 +#endif        /* ! RC_INVOKED */
 +#endif        /* !__STRING_H_SOURCED__ */
 +#if ! (defined RC_INVOKED || (defined _WCHAR_H && defined _STRING_H))
 +/* ...such that these declarations are exposed when either _WCHAR_H, or
 + * _STRING_H is defined, (but not both, since that would indicate that
 + * these declarations have already been processed).
 + *
 + *
 + * Wide character versions of the ISO-C standard string functions.
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcscat (wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcschr (const wchar_t *, wchar_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int wcscmp (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int wcscoll (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcscpy (wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  size_t wcscspn (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  size_t wcslen (const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsncat (wchar_t *, const wchar_t *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int wcsncmp (const wchar_t *, const wchar_t *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsncpy (wchar_t *, const wchar_t *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcspbrk (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsrchr (const wchar_t *, wchar_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  size_t wcsspn (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsstr (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcstok (wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  size_t wcsxfrm (wchar_t *, const wchar_t *, size_t);
  
 -#ifdef __cplusplus
 -extern "C" {
 -#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
 -#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   _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   _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*);
 -
 -/* These differ from the ISO C prototypes, which have a maxlen parameter like snprintf.  */
  #ifndef __STRICT_ANSI__
 -_CRTIMP int __cdecl __MINGW_NOTHROW   swprintf (wchar_t*, const wchar_t*, ...);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   vswprintf (wchar_t*, const wchar_t*, __VALIST);
 -#endif
 +/* UTF-16LE versions of non-ANSI string functions provided by CRTDLL.DLL
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsdup (const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _wcsicmp (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _wcsicoll (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcslwr (wchar_t*);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _wcsnicmp (const wchar_t *, const wchar_t *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsnset (wchar_t *, wchar_t, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsrev (wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsset (wchar_t *, wchar_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsupr (wchar_t *);
  
  #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, const 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__ */
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _wcsncoll (const wchar_t *, const wchar_t *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int _wcsnicoll (const wchar_t *, const wchar_t *, size_t);
 +
 +/* A wide character counterpart to the strerror() API was introduced in
 + * MSVCR70.DLL, and subsequently back-ported to MSVCRT.DLL in WinXP.
 + */
 +#if __MSVCRT_VERSION__ >= __MSVCR70_DLL || NTDDI_VERSION >= NTDDI_WINXP
 + /*
 +  * These are are the wide character counterparts to the strerror()
 +  * function itself, and the _strerror() function, respectively.
 +  */
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcserror (int);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *__wcserror (const wchar_t *);
 +
 +#endif        /* MSVCR70.DLL || WinXP */
  #endif        /* __MSVCRT__ */
  
 -#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
 -int __cdecl __MINGW_NOTHROW snwprintf (wchar_t*, size_t, const wchar_t*, ...);
 -int __cdecl __MINGW_NOTHROW vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST);
 +/* MSVCRT.DLL provides neither _wcscmpi() nor wcscmpi(); the heritage
 + * is uncertain, but for the convenience, (and portability), of legacy
 + * applications which assume wcscmpi() should be available:
 + */
 +#define _wcscmpi _wcsicmp
 +int __cdecl __MINGW_NOTHROW  wcscmpi (const wchar_t *, const wchar_t *);
 +
  #ifndef __NO_INLINE__
 -__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);}
 -#endif
 -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);
 -#endif
 +__CRT_ALIAS __JMPSTUB__(( FUNCTION = wcscmpi, REMAPPED = _wcsicmp ))
 +  int wcscmpi (const wchar_t *__ws1, const wchar_t *__ws2)
 +  { return _wcsicmp (__ws1, __ws2); }
 +#endif        /* __NO_INLINE__ */
 +
 +#ifndef _NO_OLDNAMES
 +/* Older CRTDLL.DLL versions may have provided these alternatively named
 + * functions; we continue to support them, via the OLDNAME libraries:
 + */
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsdup (const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int wcsicmp (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int wcsicoll (const wchar_t *, const wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcslwr (wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  int wcsnicmp (const wchar_t *, const wchar_t *, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsnset (wchar_t *, wchar_t, size_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsrev (wchar_t *);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsset (wchar_t *, wchar_t);
 +_CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsupr (wchar_t *);
 +
 +#endif        /* !_NO_OLDNAMES */
 +#endif        /* !__STRICT_ANSI__ */
 +
 +/* This completes the set of declarations which are to be duplicated by
 + * inclusion of <string.h>; revert the declarative condition, to make it
 + * specific to <wchar.h> alone.
 + */
 +#endif        /* !(RC_INVOKED || (_WCHAR_H && _STRING_H)) */
 +#if defined _WCHAR_H && ! defined RC_INVOKED
  
 -#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
 -_CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *, wchar_t **, int);
 -_CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *, wchar_t **, int, _locale_t);
 -_CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *, wchar_t **, int);
 -_CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *, wchar_t **, int, _locale_t);
 -#define  _WSTDLIB_DEFINED
 -#endif /* _WSTDLIB_DEFINED */
 -
 -#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*);
 -#if __MSVCRT_VERSION__ < 0x0800
 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW      _wctime (const time_t*);
 -#endif
 -_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
 -#if __MSVCRT_VERSION__ >= 0x0800
 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW      _wctime32 (const __time32_t*);
 -#ifndef _USE_32BIT_TIME_T
 -_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW    _wctime (const time_t* _v)      { return(_wctime64 (_v)); }
 -#else
 -_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW    _wctime (const time_t* _v)      { return(_wctime32 (_v)); }
 -#endif
 +typedef wchar_t  _Wint_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 */
 -
 +typedef int mbstate_t;
  
 -#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.
 +/* The following multi-byte character conversion functions are
 + * implemented in libmingwex.a, (and maybe also in some non-free
 + * Microsoft libraries, such as MSVCP60.DLL and later).
   */
 +__cdecl __MINGW_NOTHROW  wint_t btowc (int);
 +__cdecl __MINGW_NOTHROW  int wctob (wint_t);
  
 -/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
 -#define               _wcscmpi        _wcsicmp
 +__cdecl __MINGW_NOTHROW
 +size_t mbrlen (const char *__restrict__, size_t, mbstate_t *__restrict__);
  
 -_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*);
 +__cdecl __MINGW_NOTHROW  size_t mbrtowc
 +(wchar_t *__restrict__, const char *__restrict__, size_t, mbstate_t *__restrict__);
  
 -#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
 +__cdecl __MINGW_NOTHROW  size_t mbsrtowcs
 +(wchar_t *__restrict__, const char **__restrict__, size_t, mbstate_t *__restrict__);
  
 -#ifndef       _NO_OLDNAMES
 -/* NOTE: There is no _wcscmpi, but this is for compatibility. */
 -int __cdecl __MINGW_NOTHROW wcscmpi (const wchar_t *, const wchar_t *);
 -#ifndef __NO_INLINE__
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW
 -wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2)
 -  {return _wcsicmp (__ws1, __ws2);}
 -#endif
 -_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 */
 -
 -#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
 +__cdecl __MINGW_NOTHROW
 +size_t wcrtomb (char * __restrict__, wchar_t, mbstate_t *__restrict__);
  
 -typedef int mbstate_t;
 +__cdecl __MINGW_NOTHROW  size_t wcsrtombs
 +(char *__restrict__, const wchar_t **__restrict__, size_t, mbstate_t *__restrict__);
 +
 +#ifdef _ISOC99_SOURCE
 +/* These ISO-C99 functions are implemented in libmingwex.a,
 + * or, in some cases, by inline stubs.
 + */
 +__cdecl __MINGW_NOTHROW  int fwide (FILE *, int);
 +__cdecl __MINGW_NOTHROW  int mbsinit (const 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 __NO_ISOCEXT /* these need static lib libmingwex.a */
 -int __cdecl __MINGW_NOTHROW fwide(FILE*, int);
 -int __cdecl __MINGW_NOTHROW mbsinit(const mbstate_t*);
  #ifndef __NO_INLINE__
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW fwide(FILE* __UNUSED_PARAM(stream),
 -                                             int mode)
 -  {return mode;} /* Nothing to do  */
 -__CRT_INLINE int __cdecl __MINGW_NOTHROW mbsinit(const mbstate_t* __UNUSED_PARAM(ps))
 -  {return 1;}
 -#endif
 -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       __STRICT_ANSI__
 -/* non-ANSI wide char functions from io.h, direct.h, sys/stat.h and locale.h.  */
 -
 -#ifndef       _FSIZE_T_DEFINED
 -typedef       unsigned long   _fsize_t;
 -#define _FSIZE_T_DEFINED
 -#endif
 +__CRT_INLINE __cdecl __MINGW_NOTHROW
 +int fwide (FILE *__UNUSED_PARAM(stream), int mode)
 +  { return mode; } /* Nothing to do  */
  
 -#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];
 -};
 -#if __MSVCRT_VERSION__ >= 0x0601
 -struct __wfinddata64_t {
 -        unsigned    attrib;
 -        __time64_t  time_create;
 -        __time64_t  time_access;
 -        __time64_t  time_write;
 -/* 8 bytes are returned so it can't be _fsize_t */
 -        __int64    size;
 -        wchar_t     name[260];
 -};
 -#endif
 -#if __MSVCRT_VERSION__ >= 0x0800
 -#include <stdio.h>
 -struct __wfinddata32_t {
 -      unsigned        attrib;
 -      __time32_t      time_create;
 -      __time32_t      time_access;
 -      __time32_t      time_write;
 -      __int32         size;
 -      wchar_t         name[FILENAME_MAX];
 -};
 -
 -struct _wfinddata32i64_t {
 -      unsigned        attrib;
 -      __time32_t      time_create;
 -      __time32_t      time_access;
 -      __time32_t      time_write;
 -      __int64         size;
 -      wchar_t         name[FILENAME_MAX];
 -};
 -
 -struct _wfinddata64i32_t {
 -      unsigned        attrib;
 -      __time64_t      time_create;
 -      __time64_t      time_access;
 -      __time64_t      time_write;
 -      __int32         size;
 -      wchar_t         name[FILENAME_MAX];
 -};
 -#endif /* __MSVCRT_VERSION__ >= 0x0800 */
 -#define _WFINDDATA_T_DEFINED
 +__CRT_INLINE __cdecl __MINGW_NOTHROW
 +int mbsinit (const mbstate_t *__UNUSED_PARAM(ps))
 +  { return 1; }
  #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);
 -#if __MSVCRT_VERSION__ < 0x0800
 -_CRTIMP long __cdecl __MINGW_NOTHROW  _wfindfirst (const wchar_t*, struct _wfinddata_t *);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _wfindnext (long, struct _wfinddata_t *);
 -#endif
 -_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*);
 -#if __MSVCRT_VERSION__ < 0x0800
 -_CRTIMP long __cdecl __MINGW_NOTHROW  _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _wfindnexti64 (long, struct _wfinddatai64_t*);
 -#else
 -_CRTIMP long __cdecl __MINGW_NOTHROW  _wfindfirst32i64 (const wchar_t*, struct _wfinddata32i64_t*);
 -_CRTIMP long __cdecl __MINGW_NOTHROW  _wfindfirst64i32 (const wchar_t*, struct _wfinddata64i32_t*);
 -_CRTIMP int  __cdecl __MINGW_NOTHROW  _wfindnext32i64 (long, struct _wfinddata32i64_t*);
 -_CRTIMP int  __cdecl __MINGW_NOTHROW  _wfindnext64i32 (long, struct _wfinddata64i32_t*);
 -#endif /* __MSVCRT_VERSION__ < 0x0800 */
 -#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 */
 -#if __MSVCRT_VERSION__ >= 0x0800
 -_CRTIMP long __cdecl __MINGW_NOTHROW  _wfindfirst32 (const wchar_t*, struct __wfinddata32_t*);
 -_CRTIMP int  __cdecl __MINGW_NOTHROW  _wfindnext32 (long, struct __wfinddata32_t*);
 -#ifndef _USE_32BIT_TIME_T
 -_CRTALIAS long __cdecl __MINGW_NOTHROW        _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2)       { return(_wfindfirst64i32 (_v1,(struct _wfinddata64i32_t*)_v2)); }
 -_CRTALIAS int  __cdecl __MINGW_NOTHROW        _wfindnext (long _v1, struct _wfinddata_t* _v2)                  { return(_wfindnext64i32  (_v1,(struct _wfinddata64i32_t*)_v2)); }
 -_CRTALIAS long __cdecl __MINGW_NOTHROW        _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2) { return(_wfindfirst64 (_v1,(struct __wfinddata64_t*)_v2)); }
 -_CRTALIAS int  __cdecl __MINGW_NOTHROW        _wfindnexti64 (long _v1, struct _wfinddatai64_t* _v2)            { return(_wfindnext64  (_v1,(struct __wfinddata64_t*)_v2)); }
 -#else
 -_CRTALIAS long __cdecl __MINGW_NOTHROW        _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2)       { return(_wfindfirst32 (_v1,(struct __wfinddata32_t*)_v2)); }
 -_CRTALIAS int  __cdecl __MINGW_NOTHROW        _wfindnext (long _v1, struct _wfinddata_t* _v2)                  { return(_wfindnext32  (_v1,(struct __wfinddata32_t*)_v2)); }
 -_CRTALIAS long __cdecl __MINGW_NOTHROW        _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2) { return(_wfindfirst32i64 (_v1,(struct _wfinddata32i64_t*)_v2)); }
 -_CRTALIAS int  __cdecl __MINGW_NOTHROW        _wfindnexti64 (long _v1, struct _wfinddatai64_t* _v2)            { return(_wfindnext32i64  (_v1,(struct _wfinddata32i64_t*)_v2)); }
 -#endif /* !_USE_32BIT_TIME_T*/
 -#endif /* __MSVCRT_VERSION__ >= 0x0800 */
 -
 -#endif /* defined (__MSVCRT__) */
 -#define _WIO_DEFINED
 -#endif /* _WIO_DEFINED */
 -
 -#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 */
 +__cdecl __MINGW_NOTHROW  wchar_t *wmemset (wchar_t *, wchar_t, size_t);
 +__cdecl __MINGW_NOTHROW  wchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
  
 -#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!
 +/* FIXME: what makes this so different from every other function
 + * in this group?  Why is it not qualified with the __cdecl, and
 + * __MINGW_NOTHROW attributes?
   */
 -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 {
 -    _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;
 -    __int64 st_size;
 -    time_t st_atime;
 -    time_t st_mtime;
 -    time_t st_ctime;
 -};
 -
 -#if __MSVCRT_VERSION__ >= 0x0601
 -struct __stat64
 -{
 -    _dev_t st_dev;
 -    _ino_t st_ino;
 -    _mode_t st_mode;
 -    short st_nlink;
 -    short st_uid;
 -    short st_gid;
 -    _dev_t st_rdev;
 -    __int64 st_size;
 -    __time64_t st_atime;
 -    __time64_t st_mtime;
 -    __time64_t st_ctime;
 -};
 -#endif  /* __MSVCRT_VERSION__ >= 0x0601*/
 -
 -#if __MSVCRT_VERSION__ >= 0x0800
 -struct __stat32
 -{
 -      _dev_t          st_dev;
 -      _ino_t          st_ino;
 -      _mode_t         st_mode;
 -      short           st_nlink;
 -      short           st_uid;
 -      short           st_gid;
 -      _dev_t          st_rdev;
 -      __int32         st_size;
 -      __time32_t      st_atime;
 -      __time32_t      st_mtime;
 -      __time32_t      st_ctime;
 -};
 -struct _stat32i64 {
 -      _dev_t          st_dev;
 -      _ino_t          st_ino;
 -      _mode_t         st_mode;
 -      short           st_nlink;
 -      short           st_uid;
 -      short           st_gid;
 -      _dev_t          st_rdev;
 -      __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;
 -      _mode_t         st_mode;
 -      short           st_nlink;
 -      short           st_uid;
 -      short           st_gid;
 -      _dev_t          st_rdev;
 -      __int32         st_size;
 -      __time64_t      st_atime;
 -      __time64_t      st_mtime;
 -      __time64_t      st_ctime;
 -};
 -#endif /* __MSVCRT_VERSION__ >= 0x0800 */
 -
 -#endif  /* __MSVCRT__ */
 -#define _STAT_DEFINED
 -#endif /* _STAT_DEFINED */
 -
 -#if !defined ( _WSTAT_DEFINED)
 -/* also declared in sys/stat.h */
 -#if defined __MSVCRT__
 -#if __MSVCRT_VERSION__ < 0x0800
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _wstat (const wchar_t*, struct _stat*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _wstati64 (const wchar_t*, struct _stati64*);
 -#endif /* __MSVCRT_VERSION__ < 0x0800 */
 -#if __MSVCRT_VERSION__ >= 0x0601
 -_CRTIMP int __cdecl __MINGW_NOTHROW _wstat64 (const wchar_t*, struct __stat64*);
 -#endif /* __MSVCRT_VERSION__ >= 0x0601 */
 -#if __MSVCRT_VERSION__ >= 0x0800
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _wstat32 (const wchar_t*, struct __stat32*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _wstat32i64 (const wchar_t*, struct _stat32i64*);
 -_CRTIMP int __cdecl __MINGW_NOTHROW   _wstat64i32 (const wchar_t*, struct _stat64i32*);
 -#ifndef _USE_32BIT_TIME_T
 -_CRTALIAS int __cdecl __MINGW_NOTHROW _wstat (const wchar_t* _v1, struct _stat* _v2)       { return(_wstat64i32 (_v1,(struct _stat64i32*)_v2)); }
 -_CRTALIAS int __cdecl __MINGW_NOTHROW _wstati64 (const wchar_t* _v1, struct _stati64* _v2) { return(_wstat64 (_v1,(struct __stat64*)_v2)); }
 -#else
 -_CRTALIAS int __cdecl __MINGW_NOTHROW _wstat (const wchar_t* _v1, struct _stat* _v2)       { return(_wstat32 (_v1,(struct __stat32*)_v2)); }
 -_CRTALIAS int __cdecl __MINGW_NOTHROW _wstati64 (const wchar_t* _v1, struct _stati64* _v2) { return(_wstat32i64 (_v1,(struct _stat32i64*)_v2)); }
 -#endif /* !_USE_32BIT_TIME_T */
 -#endif /* __MSVCRT_VERSION__ >= 0x0800 */
 -#endif  /* __MSVCRT__ */
 -#define _WSTAT_DEFINED
 -#endif /* ! _WSTAT_DEFIND  */
 -
 -#ifndef _WLOCALE_DEFINED  /* also declared in locale.h */
 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wsetlocale (int, const wchar_t*);
 -#define _WLOCALE_DEFINED
 -#endif
 +int wmemcmp (const wchar_t *, const wchar_t *, size_t);
  
 -#ifndef _WPROCESS_DEFINED  /* also declared in process.h */
 -#include <stdint.h>  /* For intptr_t.  */
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecl      (const wchar_t*, const wchar_t*, ...);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecle     (const wchar_t*, const wchar_t*, ...);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexeclp     (const wchar_t*, const wchar_t*, ...);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexeclpe    (const wchar_t*, const wchar_t*, ...);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecv      (const wchar_t*, const wchar_t* const*);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecve     (const wchar_t*, const wchar_t* const*, const wchar_t* const*);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecvp     (const wchar_t*, const wchar_t* const*);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecvpe    (const wchar_t*, const wchar_t* const*, const wchar_t* const*);
 -
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnl     (int, const wchar_t*, const wchar_t*, ...);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnle    (int, const wchar_t*, const wchar_t*, ...);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnlp    (int, const wchar_t*, const wchar_t*, ...);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnlpe   (int, const wchar_t*, const wchar_t*, ...);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnv     (int, const wchar_t*, const wchar_t* const*);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnve    (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnvp    (int, const wchar_t*, const wchar_t* const*);
 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnvpe   (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*);
 -
 -#define _WPROCESS_DEFINED
 -#endif
 -#endif /* not __STRICT_ANSI__ */
 +__cdecl __MINGW_NOTHROW
 +wchar_t *wmemcpy (wchar_t *__restrict__, const wchar_t *__restrict__, size_t);
  
 -#ifdef __cplusplus
 -}     /* end of extern "C" */
 -#endif
 +__cdecl __MINGW_NOTHROW  wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
 +
 +__cdecl __MINGW_NOTHROW
 +long long wcstoll (const wchar_t *__restrict__, wchar_t **__restrict__, int);
  
 -#endif /* Not RC_INVOKED */
 +__cdecl __MINGW_NOTHROW  unsigned long long wcstoull
 +(const wchar_t *__restrict__, wchar_t **__restrict__, int);
 +#endif /* _ISOC99_SOURCE */
  
 -#endif /* not _WCHAR_H_ */
 +_END_C_DECLS
  
 +#undef __WCHAR_H_SOURCED__
 +#endif        /* _WCHAR_H && ! RC_INVOKED */
 +#endif        /* !_WCHAR_H: $RCSfile$: end of file */