The MinGW.org Windows System Libraries
修訂 | 92c9c73c5a85fb74ad7586fcf6243d0a777a6c25 (tree) |
---|---|
時間 | 2020-03-13 07:44:03 |
作者 | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Rationalize implementations of fwide() and mbsinit() functions.
@@ -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 | + | |
1 | 14 | 2020-03-11 Keith Marshall <keith@users.osdn.me> |
2 | 15 | |
3 | 16 | Correct a defect in detection of failed btowc() conversions. |
@@ -468,8 +468,8 @@ libmingwex.a: $(addsuffix .$(OBJEXT), mkstemp mkdtemp cryptnam setenv) | ||
468 | 468 | |
469 | 469 | vpath %.s ${mingwrt_srcdir}/mingwex |
470 | 470 | 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) | |
473 | 473 | libmingwex.a: $(addsuffix .$(OBJEXT), wcrtomb wcsrtombs wcsnlen wcstod wcstof) |
474 | 474 | libmingwex.a: $(addsuffix .$(OBJEXT), wcstofp wcstold wctob wctrans wctype) |
475 | 475 | libmingwex.a: $(addsuffix .$(OBJEXT), wmemchr wmemcmp wmemcpy wmemmove wmemset) |
@@ -667,13 +667,13 @@ __cdecl __MINGW_NOTHROW int fwide (FILE *, int); | ||
667 | 667 | __cdecl __MINGW_NOTHROW int mbsinit (const mbstate_t *); |
668 | 668 | |
669 | 669 | #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 */ | |
673 | 673 | |
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))); } | |
677 | 677 | #endif |
678 | 678 | |
679 | 679 | __cdecl __MINGW_NOTHROW wchar_t *wmemset (wchar_t *, wchar_t, size_t); |
@@ -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 | - |
@@ -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 | - |