mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 13:31:24 +00:00
- Update fputwc implementation to current wine sources
- Fixes 23 msvcrt file winetests svn path=/trunk/; revision=38185
This commit is contained in:
parent
855ea53e48
commit
f45ee646df
1 changed files with 4 additions and 22 deletions
|
@ -2167,28 +2167,10 @@ size_t CDECL fwrite(const void *ptr, size_t size, size_t nmemb, FILE* file)
|
||||||
*/
|
*/
|
||||||
wint_t CDECL fputwc(wint_t wc, FILE* file)
|
wint_t CDECL fputwc(wint_t wc, FILE* file)
|
||||||
{
|
{
|
||||||
if (file->_flag & _IOBINARY)
|
wchar_t mwc=wc;
|
||||||
{
|
if (fwrite( &mwc, sizeof(mwc), 1, file) != 1)
|
||||||
if (fwrite(&wc, sizeof(wc), 1, file) != 1)
|
return WEOF;
|
||||||
return WEOF;
|
return wc;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Convert to multibyte in text mode */
|
|
||||||
char mbc[MB_LEN_MAX];
|
|
||||||
int mb_return;
|
|
||||||
|
|
||||||
mb_return = wctomb(mbc, wc);
|
|
||||||
|
|
||||||
if(mb_return == -1)
|
|
||||||
return WEOF;
|
|
||||||
|
|
||||||
/* Output all characters */
|
|
||||||
if (fwrite(mbc, mb_return, 1, file) != 1)
|
|
||||||
return WEOF;
|
|
||||||
}
|
|
||||||
|
|
||||||
return wc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue