• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

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

修訂92c9c73c5a85fb74ad7586fcf6243d0a777a6c25 (tree)
時間2020-03-13 07:44:03
作者Keith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Rationalize implementations of fwide() and mbsinit() functions.

Change Summary

差異

--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,16 @@
1+2020-03-12 Keith Marshall <keith@users.osdn.me>
2+
3+ Rationalize implementations of fwide() and mbsinit() functions.
4+
5+ * include/wchar.h (mbsinit): Mark as __LIBIMPL__; reimplement its
6+ inline definition, to evaluate its mbstate_t reference argument.
7+ (fwide): Mark as __LIBIMPL__.
8+
9+ * Makefile.in (libmingwex.a): Remove explicit dependencies on...
10+ (fwide, mbsinit): ...these; they are implied by __LIBIMPL__ marks.
11+
12+ * mingwex/fwide.c mingwex/mbsinit.c: Redundant files; delete them.
13+
114 2020-03-11 Keith Marshall <keith@users.osdn.me>
215
316 Correct a defect in detection of failed btowc() conversions.
--- a/mingwrt/Makefile.in
+++ b/mingwrt/Makefile.in
@@ -468,8 +468,8 @@ libmingwex.a: $(addsuffix .$(OBJEXT), mkstemp mkdtemp cryptnam setenv)
468468
469469 vpath %.s ${mingwrt_srcdir}/mingwex
470470 vpath %.sx ${mingwrt_srcdir}/mingwex
471-libmingwex.a: $(addsuffix .$(OBJEXT), codeset fwide mbrconv mbrscan mbrlen)
472-libmingwex.a: $(addsuffix .$(OBJEXT), mbrtowc mbsrtowcs mbsinit strnlen wcharmap)
471+libmingwex.a: $(addsuffix .$(OBJEXT), codeset mbrconv mbrscan mbrlen)
472+libmingwex.a: $(addsuffix .$(OBJEXT), mbrtowc mbsrtowcs strnlen wcharmap)
473473 libmingwex.a: $(addsuffix .$(OBJEXT), wcrtomb wcsrtombs wcsnlen wcstod wcstof)
474474 libmingwex.a: $(addsuffix .$(OBJEXT), wcstofp wcstold wctob wctrans wctype)
475475 libmingwex.a: $(addsuffix .$(OBJEXT), wmemchr wmemcmp wmemcpy wmemmove wmemset)
--- a/mingwrt/include/wchar.h
+++ b/mingwrt/include/wchar.h
@@ -667,13 +667,13 @@ __cdecl __MINGW_NOTHROW int fwide (FILE *, int);
667667 __cdecl __MINGW_NOTHROW int mbsinit (const mbstate_t *);
668668
669669 #ifndef __NO_INLINE__
670-__CRT_INLINE __cdecl __MINGW_NOTHROW
671-int fwide (FILE *__UNUSED_PARAM(stream), int mode)
672- { return mode; } /* Nothing to do */
670+__CRT_INLINE __LIBIMPL__(( FUNCTION = fwide ))
671+__cdecl __MINGW_NOTHROW int fwide (FILE *__UNUSED_PARAM(__stream), int __mode)
672+{ return __mode; } /* Nothing to do */
673673
674-__CRT_INLINE __cdecl __MINGW_NOTHROW
675-int mbsinit (const mbstate_t *__UNUSED_PARAM(ps))
676- { return 1; }
674+__CRT_INLINE __LIBIMPL__(( FUNCTION = mbsinit ))
675+__cdecl __MINGW_NOTHROW int mbsinit (const mbstate_t *__ps)
676+{ return ((__ps == NULL) || (*__ps == (mbstate_t)(0))); }
677677 #endif
678678
679679 __cdecl __MINGW_NOTHROW wchar_t *wmemset (wchar_t *, wchar_t, size_t);
--- a/mingwrt/mingwex/fwide.c
+++ /dev/null
@@ -1,9 +0,0 @@
1-#include <wchar.h>
2-#include <stdio.h>
3-
4-int
5-fwide(FILE* stream, int mode)
6-{
7- return mode; /* Nothing to do. */
8-}
9-
--- a/mingwrt/mingwex/mbsinit.c
+++ /dev/null
@@ -1,21 +0,0 @@
1-/* This source code was extracted from the Q8 package created and placed
2- in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
3- last edit: 1999/11/05 gwyn@arl.mil
4-
5- Implements subclause 7.24 of ISO/IEC 9899:1999 (E).
6-
7- It supports an encoding where all char codes are mapped
8- to the *same* code values within a wchar_t or wint_t,
9- so long as no other wchar_t codes are used by the program.
10-
11-*/
12-
13-#include <wchar.h>
14-
15-int
16-mbsinit(ps)
17- const mbstate_t *ps;
18- {
19- return 1; /* don't have shift states */
20- }
21-