mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 12:06:52 +00:00
[CMAKE]
- Sync with trunk r51165. svn path=/branches/cmake-bringup/; revision=51166
This commit is contained in:
commit
475719f162
249 changed files with 13280 additions and 5238 deletions
|
@ -2175,12 +2175,33 @@ size_t CDECL fwrite(const void *ptr, size_t size, size_t nmemb, FILE* file)
|
|||
/*********************************************************************
|
||||
* fputwc (MSVCRT.@)
|
||||
*/
|
||||
wint_t CDECL fputwc(wint_t wc, FILE* file)
|
||||
wint_t CDECL fputwc(wchar_t c, FILE* stream)
|
||||
{
|
||||
wchar_t mwc=wc;
|
||||
if (fwrite( &mwc, sizeof(mwc), 1, file) != 1)
|
||||
return WEOF;
|
||||
return wc;
|
||||
/* If this is a real file stream (and not some temporary one for
|
||||
sprintf-like functions), check whether it is opened in text mode.
|
||||
In this case, we have to perform an implicit conversion to ANSI. */
|
||||
if (!(stream->_flag & _IOSTRG) && fdesc[stream->_file].wxflag & WX_TEXT)
|
||||
{
|
||||
/* Convert to multibyte in text mode */
|
||||
char mbc[MB_LEN_MAX];
|
||||
int mb_return;
|
||||
|
||||
mb_return = wctomb(mbc, c);
|
||||
|
||||
if(mb_return == -1)
|
||||
return WEOF;
|
||||
|
||||
/* Output all characters */
|
||||
if (fwrite(mbc, mb_return, 1, stream) != 1)
|
||||
return WEOF;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fwrite(&c, sizeof(c), 1, stream) != 1)
|
||||
return WEOF;
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue