OSDN Git Service

Correct a defect in detection of failed btowc() conversions.
[mingw/mingw-org-wsl.git] / mingwrt / ChangeLog
index 70d3932..411fd49 100644 (file)
@@ -1,3 +1,191 @@
+2020-03-11  Keith Marshall  <keith@users.osdn.me>
+
+       Correct a defect in detection of failed btowc() conversions.
+
+       * mingwex/btowc.c (__mingw_btowc_fallback): Use...
+       (__mingw_mbtowc_convert): ...this; verify successful conversion of
+       exactly one byte, to equivalent wchar, otherwise return WEOF.
+       (__mingw_btowc, __msvcrt_btowc): Delegate codeset initialization to...
+       (__mingw_mbrtowc_codeset_init): ...this, so delegating its management
+       externally; remove local provision.
+
+2020-03-10  Keith Marshall  <keith@users.osdn.me>
+
+       Correct defects in mbrtowc() invalid conversion state handling.
+
+       * mingwex/mbrconv.c (__mingw_mbrtowc_handler): Abort if restarting a
+       conversion when a low surrogate is pending, but has not been correctly
+       retrieved; additionally, reject any mbstate_t object content which is
+       already representative of a complete multibyte character sequence.
+
+2020-03-10  Keith Marshall  <keith@users.osdn.me>
+
+       Base MBCS converter function call redirection on _ISOC99_SOURCE.
+
+       * include/wchar.h (__mingw_redirect): New temporary macro; use it...
+       (btowc, mbrlen, mbrtowc, mbsrtowcs, wctob, wcrtomb, wcsrtombs): ...in
+       each of these inline function definitions, to select between use of...
+       [defined _ISOC99_SOURCE]: ...direct call to MinGW function, or...
+       [! defined _ISOC99_SOURCE]: ...attempt to call MSVCRT.DLL function,
+       with fall back to MinGW, when no MSVCRT.DLL function available.
+
+2020-03-05  Keith Marshall  <keith@users.osdn.me>
+
+       Prepare and publish MinGW.org WSL-5.3 release.
+
+       * All files (wsl-5.3-release): Tag assigned.
+
+2020-03-05  Keith Marshall  <keith@users.osdn.me>
+
+       Let _ISOC11_SOURCE imply _ISOC99_SOURCE.
+
+       * include/_mingw.h.in [! defined _ISOC99_SOURCE]
+       [defined _ISOC11_SOURCE] (_ISOC99_SOURCE): Define as 0x0F.
+
+2020-03-05  Keith Marshall  <keith@users.osdn.me>
+
+       Avoid deprecated specification of esp in asm clobber list.
+
+       * crt1.c (__mingw_CRTStartup): In inline assembly, forced modulo-16
+       alignment of esp is safe, but clobbered esp cannot be restored; GCC-9
+       deprecates its inclusion in clobber list; remove it.
+       [-masm=intel]: Support inline assembler syntax.
+
+2020-03-04  Keith Marshall  <keith@users.osdn.me>
+
+       Disallow surrogates as printf() radix and grouping characters.
+
+       * mingwex/stdio/pformat.c (__pformat_emit_digit)
+       [(c == '.') && ((rpchr & 0xF800) == 0xD800)]: Radix point requires a
+       surrogate pair, for representation as UTF-16LE; decline to use it.
+       (__pformat_enable_thousands_grouping) [(tc & 0xF800) == 0xD800]:
+       Likewise, for thousands group separator.
+
+2020-03-04  Keith Marshall  <keith@users.osdn.me>
+
+       Reimplement wcstof(), and wcstold() functions.
+
+       * mingwex/wcstofp.c: New file; it implements...
+       (wcstof, wcstold): ...these functions; each is an alias for...
+       (__mingw_wcstof, __mingw_wcstold): ...these, respectively; also...
+       (__mingw_wcstod): ...this; all are implemented in terms of...
+       (__mingw_wcstofp_prescan, __mingw_wcstofp_prepare)
+       (__mingw_wcstofp_bufsize): ...these; implement them.
+
+       * Makefile.in (libmingwex.a): Add dependency references...
+       (wcstofp.$OBJEXT, wcstod.$OBJEXT): ...for these; also include with...
+       (wcstof.$OBJEXT, wcstold.$OBJEXT): ...these, in new build rule.
+
+       * include/stdlib.h (__mingw_wcstod, __mingw_wcstof)
+       (__mingw_wcstold): Declare them.
+
+       * mingwex/mb_wc_common.h mingwex/wcstof.c mingwex/wcstold.c: Files
+       are obsolete, and no longer required; delete them.
+
+2020-03-03  Keith Marshall  <keith@users.osdn.me>
+
+       Reimplement btowc(), and wctob() functions.
+
+       * include/wchar.h [__MSVCRT_VERSION__ < __MSVCR80_DLL]
+       (btowc, wctob): Implement them as static inline redirects...
+       (__msvcrt_btowc, __msvcrt_wctob): ...to these; declare them, with
+       additional MinGW specific alternatives declared...
+       (__mingw_btowc, __mingw_wctob): ...thus.
+
+       * mingwex/btowc.c: Rewrite as new; it now implements...
+       (__mingw_btowc, __msvcrt_btowc): ...these public API functions, either
+       of which serves as a suitable replacement entry point for...
+       (btowc): ...this, with ultimate fallback served by...
+       (__mingw_btowc_fallback): ...this private function.
+
+       * mingwex/wctob.c: Rewrite as new; it now implements...
+       (__mingw_wctob, __msvcrt_wctob): ...these public API functions, either
+       of which serves as a suitable replacement entry point for...
+       (wctob): ...this, with ultimate fallback served by...
+       (__mingw_wctob_fallback): ...this private function.
+
+2020-03-02  Keith Marshall  <keith@users.osdn.me>
+
+       Reimplement mbrlen(), mbrtowc(), and mbsrtowcs() functions.
+
+       * include/wchar.h [__MSVCRT_VERSION__ < __MSVCR80_DLL]
+       (mbrlen, mbrtowc, mbsrtowcs): Implement as static inline redirects...
+       (__msvcrt_mbrlen, __msvcrt_mbrtowc, __msvcrt_mbsrtowcs): ...to these;
+       declare them, with additional MinGW specific alternatives declared...
+       (__mingw_mbrlen, __mingw_mbrtowc, __mingw_mbsrtowcs): ...thus.
+
+       * mingwex/mbsrtowcs.c: New file; it implements...
+       (__mingw_mbsrtowcs, __msvcrt_mbsrtowcs): ...this pair of new
+       functions, either of which serves as a replacement for...
+       (mbsrtowcs): ...this; it was originally implemented...
+       * mingwex/mbrtowc.c: ...here; rewritten as new, it now implements...
+       (__mingw_mbrtowc, __msvcrt_mbrtowc): ...these new functions,
+       either of which serves as a public API replacement for...
+       (mbrtowc): ...this; with ultimate fallback served by...
+       (__mingw_mbrtowc_fallback): ...this private function.
+
+       * mingwex/mbrlen.c: New file; it implements...
+       (__mingw_mbrlen, __msvcrt_mbrlen): ...these public API entries, and...
+       (__mingw_mbrlen_fallback): ...this supporting private function.
+
+       * mingwex/mbrconv.c: New file; it implements...
+       (__mingw_mbrtowc_handler): ...this backend interpreter, shared by...
+       (__mingw_mbrlen_fallback, __mingw_mbrtowc_fallback): ...these.
+
+       * mingwex/mbrscan.c: New file; it implements...
+       (__mingw_mbtowc_codeset_init, __mingw_mbtowc_cur_max_init)
+       (__mingw_mbtowc_cur_max): ...these TLS accessor functions, and...
+       (__mingw_mbrscan_begin, __mingw_mbtowc_convert, __mingw_mbtowc_copy):
+       ...these MBCS to wide character conversion helper functions.
+
+       * mingwex/wcharmap.h (boolean): Define new private use data type...
+       (false, true): ...with these effective symbolic values; define them.
+       (__mingw_mbtowc_codeset_init, __mingw_mbtowc_cur_max_init)
+       (__mingw_mbtowc_cur_max, __mingw_mbrscan_begin, __mingw_mbtowc_copy)
+       (__mingw_mbtowc_convert): Declare them.
+
+       * Makefile.in (libmingwex.a): Add dependency references for...
+       (mbrconv.$OBJEXT, mbrscan.$OBJEXT, mbrlen.$OBJEXT, mbsrtowcs.$OBJEXT):
+       ...these.
+
+2020-02-25  Keith Marshall  <keith@users.osdn.me>
+
+       Reimplement wcrtomb() and wcsrtombs(); cf. MinGW-Issue #39687.
+
+       * include/wchar.h [__MSVCRT_VERSION__ < __MSVCR80_DLL]
+       (wcrtomb, wcsrtombs): Implement them as static inline redirects to...
+       (__msvcrt_wcrtomb, __msvcrt_wcsrtombs): ...these; declare them.
+       (__mingw_wcrtomb, __mingw_wcsrtombs): Also declare these.
+
+       * include/limits.h (MB_LEN_MAX): Update value; was 2, but should be 5.
+
+       * mingwex/wcsrtombs.c: New file; it implements...
+       (__mingw_wcsrtombs, __msvcrt_wcsrtombs): ...this pair of new
+       functions, either of which serves as a replacement for...
+       (wcsrtombs): ...this; it was originally implemented...
+       * mingwex/wcrtomb.c: ...here; rewritten as new, it now implements...
+       (__mingw_wcrtomb, __msvcrt_wcrtomb): ...these new functions,
+       either of which serves as a replacement for...
+       (wcrtomb): ...this.
+
+       * mingwex/wcharmap.h: New private header; it declares the API for...
+       * mingwex/wcharmap.c: ...this new file, which implements...
+       (__mingw_wctomb_convert): ...this new function, required by...
+       (__mingw_wcrtomb, __msvcrt_wcrtomb, __mingw_wcsrtombs)
+       (__msvcrt_wcsrtombs): ...these; also provides...
+       (__mingw_wctomb_codeset_init, __mingw_wctomb_cur_max_init)
+       (__mingw_wctomb_cur_max): ...these supporting thread local storage
+       accessor functions.
+
+       * mingwex/codeset.c: New file; it implements...
+       (__mb_codeset_for_locale, __mb_len_max_for_codeset): ...this pair of
+       new helper functions; they identify the codeset, and respectively, its
+       MB_CUR_MAX for the effective process locale, which are required by...
+       (__mingw_wctomb_convert): ...this.
+
+       * Makefile.in (libmingwex.a): Add dependency references for...
+       (codeset.$OBJEXT, wcharmap.$OBJEXT, wcsrtombs.$OBJEXT): ...these.
+
 2020-01-21  Keith Marshall  <keith@users.osdn.me>
 
        Address MinGW-Issue #39658; declare rand_s() function.