msvcrt: Added _fputwc_nolock implementation.

This commit is contained in:
Iván Matellanes 2014-11-04 22:51:52 +01:00 committed by Alexandre Julliard
parent 975a95a25b
commit b536ff62ef
8 changed files with 23 additions and 9 deletions

View File

@ -832,7 +832,7 @@
@ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock
@ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s

View File

@ -1180,7 +1180,7 @@
@ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock
@ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s

View File

@ -1178,7 +1178,7 @@
@ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock
@ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s

View File

@ -499,7 +499,7 @@
@ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock
@ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s

View File

@ -481,7 +481,7 @@
@ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock
@ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s

View File

@ -3828,12 +3828,25 @@ MSVCRT_size_t CDECL MSVCRT__fwrite_nolock(const void *ptr, MSVCRT_size_t size, M
* fputwc (MSVCRT.@)
*/
MSVCRT_wint_t CDECL MSVCRT_fputwc(MSVCRT_wint_t wc, MSVCRT_FILE* file)
{
MSVCRT_wint_t ret;
MSVCRT__lock_file(file);
ret = MSVCRT__fputwc_nolock(wc, file);
MSVCRT__unlock_file(file);
return ret;
}
/*********************************************************************
* _fputwc_nolock (MSVCRT.@)
*/
MSVCRT_wint_t CDECL MSVCRT__fputwc_nolock(MSVCRT_wint_t wc, MSVCRT_FILE* file)
{
MSVCRT_wchar_t mwc=wc;
ioinfo *fdinfo;
MSVCRT_wint_t ret;
MSVCRT__lock_file(file);
fdinfo = msvcrt_get_ioinfo(file->_file);
if((fdinfo->wxflag&WX_TEXT) && !(fdinfo->exflag&(EF_UTF8|EF_UTF16))) {
@ -3841,17 +3854,16 @@ MSVCRT_wint_t CDECL MSVCRT_fputwc(MSVCRT_wint_t wc, MSVCRT_FILE* file)
int char_len;
char_len = MSVCRT_wctomb(buf, mwc);
if(char_len!=-1 && MSVCRT_fwrite(buf, char_len, 1, file)==1)
if(char_len!=-1 && MSVCRT__fwrite_nolock(buf, char_len, 1, file)==1)
ret = wc;
else
ret = MSVCRT_WEOF;
}else if(MSVCRT_fwrite(&mwc, sizeof(mwc), 1, file) == 1) {
}else if(MSVCRT__fwrite_nolock(&mwc, sizeof(mwc), 1, file) == 1) {
ret = wc;
}else {
ret = MSVCRT_WEOF;
}
MSVCRT__unlock_file(file);
return ret;
}

View File

@ -921,6 +921,7 @@ int __cdecl MSVCRT__fputc_nolock(int,MSVCRT_FILE*);
int __cdecl MSVCRT_ungetc(int,MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT__fgetwc_nolock(MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT__fputwc_nolock(MSVCRT_wint_t,MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
int __cdecl MSVCRT__fseeki64_nolock(MSVCRT_FILE*,__int64,int);
__int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file);

View File

@ -199,6 +199,7 @@ unsigned int __cdecl _set_output_format(void);
#define _WSTDIO_DEFINED
wint_t __cdecl _fgetwc_nolock(FILE*);
wint_t __cdecl _fgetwchar(void);
wint_t __cdecl _fputwc_nolock(wint_t,FILE*);
wint_t __cdecl _fputwchar(wint_t);
wchar_t* __cdecl _getws(wchar_t*);
int __cdecl _putws(const wchar_t*);