• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Windows System Libraries


Commit MetaInfo

修订版a17223919ced1cd813381644d6b84e214c9a95a8 (tree)
时间2020-03-11 00:25:38
作者Keith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Base MBCS converter function call redirection on _ISOC99_SOURCE.

更改概述

差异

--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,14 @@
1+2020-03-10 Keith Marshall <keith@users.osdn.me>
2+
3+ Base MBCS converter function call redirection on _ISOC99_SOURCE.
4+
5+ * include/wchar.h (__mingw_redirect): New temporary macro; use it...
6+ (btowc, mbrlen, mbrtowc, mbsrtowcs, wctob, wcrtomb, wcsrtombs): ...in
7+ each of these inline function definitions, to select between use of...
8+ [defined _ISOC99_SOURCE]: ...direct call to MinGW function, or...
9+ [! defined _ISOC99_SOURCE]: ...attempt to call MSVCRT.DLL function,
10+ with fall back to MinGW, when no MSVCRT.DLL function available.
11+
112 2020-03-05 Keith Marshall <keith@users.osdn.me>
213
314 Prepare and publish MinGW.org WSL-5.3 release.
--- a/mingwrt/include/wchar.h
+++ b/mingwrt/include/wchar.h
@@ -603,40 +603,58 @@ __cdecl __MINGW_NOTHROW size_t __mingw_wcsrtombs
603603 (char *__restrict__, const wchar_t **__restrict__, size_t, mbstate_t *__restrict__);
604604
605605 #if __MSVCRT_VERSION__ < __MSVCR80_DLL
606-/* FIXME: Maybe consider these mappings, even for linking with the
607- * non-free MSVCR80.DLL, and its descendants.
608- *
609- * For linking with all versions of MSVCRT.DLL, and with non-free
606+/* For linking with all versions of MSVCRT.DLL, and with non-free
610607 * alternatives predating MSVCR80.DLL, we enforce inline mapping to
611608 * the libmingwex.a implementations, (which will delegate the calls
612- * to the Microsoft DLL implementations, when they are available).
609+ * to the Microsoft DLL implementations, when they are available,
610+ * but substitute the MinGW replacements as required).
611+ */
612+#undef __mingw_redirect
613+#if _ISOC99_SOURCE & 0x08
614+/* The user has explicitly requested ISO-C99 compatibility; ensure
615+ * that calls to the following functions are serviced by the MinGW
616+ * implementations, regardless of availability of any alternative
617+ * MSVCRT.DLL implementation.
618+ */
619+# define __mingw_redirect(NAME) __mingw_##NAME
620+#else
621+/* No explicit ISO-C99 compatibility has been requested; map calls
622+ * to these functions to delegate to any MSVCRT.DLL implementations
623+ * which may be available, or to fall back to the MinGW replacement
624+ * implementations, when necessary.
625+ */
626+# define __mingw_redirect(NAME) __msvcrt_##NAME
627+#endif
628+/* FIXME: Maybe consider these mappings, even for linking with the
629+ * non-free MSVCR80.DLL, and its descendants.
613630 */
614631 __CRT_ALIAS __cdecl __MINGW_NOTHROW wint_t btowc (int __c)
615-{ return __msvcrt_btowc( __c ); }
632+{ return __mingw_redirect(btowc( __c )); }
616633
617634 __CRT_ALIAS __cdecl __MINGW_NOTHROW size_t mbrlen
618635 (const char *__mbc, size_t __n, mbstate_t *__ps)
619-{ return __msvcrt_mbrlen( __mbc, __n, __ps ); }
636+{ return __mingw_redirect(mbrlen( __mbc, __n, __ps )); }
620637
621638 __CRT_ALIAS __cdecl __MINGW_NOTHROW size_t mbrtowc
622639 (wchar_t *__wc, const char *__mbc, size_t __n, mbstate_t *__ps)
623-{ return __msvcrt_mbrtowc( __wc, __mbc, __n, __ps ); }
640+{ return __mingw_redirect(mbrtowc( __wc, __mbc, __n, __ps )); }
624641
625642 __CRT_ALIAS __cdecl __MINGW_NOTHROW size_t mbsrtowcs
626643 (wchar_t *__wcs, const char **__mbs, size_t __n, mbstate_t *__ps)
627-{ return __msvcrt_mbsrtowcs( __wcs, __mbs, __n, __ps ); }
644+{ return __mingw_redirect(mbsrtowcs( __wcs, __mbs, __n, __ps )); }
628645
629646 __CRT_ALIAS __cdecl __MINGW_NOTHROW int wctob (wint_t __wc)
630-{ return __msvcrt_wctob( __wc ); }
647+{ return __mingw_redirect(wctob( __wc )); }
631648
632649 __CRT_ALIAS __cdecl __MINGW_NOTHROW size_t wcrtomb
633650 (char * __mbc, wchar_t __wc, mbstate_t *__ps)
634-{ return __msvcrt_wcrtomb(__mbc, __wc, __ps); }
651+{ return __mingw_redirect(wcrtomb(__mbc, __wc, __ps)); }
635652
636653 __CRT_ALIAS __cdecl __MINGW_NOTHROW size_t wcsrtombs
637654 (char *__mbs, const wchar_t **__wcs, size_t __len, mbstate_t *__ps)
638-{ return __msvcrt_wcsrtombs(__mbs, __wcs, __len, __ps); }
655+{ return __mingw_redirect(wcsrtombs(__mbs, __wcs, __len, __ps)); }
639656
657+#undef __mingw_redirect
640658 #endif /* ! MSVCR80.DLL or later */
641659
642660 #if defined _ISOC99_SOURCE || defined __cplusplus