Commit b536ff62 authored by Iván Matellanes's avatar Iván Matellanes Committed by Alexandre Julliard

msvcrt: Added _fputwc_nolock implementation.

parent 975a95a2
...@@ -832,7 +832,7 @@ ...@@ -832,7 +832,7 @@
@ stub _fprintf_s_l @ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar @ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock @ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar @ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock @ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s @ stub _fread_nolock_s
......
...@@ -1180,7 +1180,7 @@ ...@@ -1180,7 +1180,7 @@
@ stub _fprintf_s_l @ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar @ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock @ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar @ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock @ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s @ stub _fread_nolock_s
......
...@@ -1178,7 +1178,7 @@ ...@@ -1178,7 +1178,7 @@
@ stub _fprintf_s_l @ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar @ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock @ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar @ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock @ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s @ stub _fread_nolock_s
......
...@@ -499,7 +499,7 @@ ...@@ -499,7 +499,7 @@
@ stub _fprintf_s_l @ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar @ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock @ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar @ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock @ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s @ stub _fread_nolock_s
......
...@@ -481,7 +481,7 @@ ...@@ -481,7 +481,7 @@
@ stub _fprintf_s_l @ stub _fprintf_s_l
@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock
@ cdecl _fputchar(long) MSVCRT__fputchar @ cdecl _fputchar(long) MSVCRT__fputchar
@ stub _fputwc_nolock @ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock
@ cdecl _fputwchar(long) MSVCRT__fputwchar @ cdecl _fputwchar(long) MSVCRT__fputwchar
@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock @ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock
@ stub _fread_nolock_s @ stub _fread_nolock_s
......
...@@ -3829,11 +3829,24 @@ MSVCRT_size_t CDECL MSVCRT__fwrite_nolock(const void *ptr, MSVCRT_size_t size, M ...@@ -3829,11 +3829,24 @@ MSVCRT_size_t CDECL MSVCRT__fwrite_nolock(const void *ptr, MSVCRT_size_t size, M
*/ */
MSVCRT_wint_t CDECL MSVCRT_fputwc(MSVCRT_wint_t wc, MSVCRT_FILE* file) 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; MSVCRT_wchar_t mwc=wc;
ioinfo *fdinfo; ioinfo *fdinfo;
MSVCRT_wint_t ret; MSVCRT_wint_t ret;
MSVCRT__lock_file(file);
fdinfo = msvcrt_get_ioinfo(file->_file); fdinfo = msvcrt_get_ioinfo(file->_file);
if((fdinfo->wxflag&WX_TEXT) && !(fdinfo->exflag&(EF_UTF8|EF_UTF16))) { 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) ...@@ -3841,17 +3854,16 @@ MSVCRT_wint_t CDECL MSVCRT_fputwc(MSVCRT_wint_t wc, MSVCRT_FILE* file)
int char_len; int char_len;
char_len = MSVCRT_wctomb(buf, mwc); 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; ret = wc;
else else
ret = MSVCRT_WEOF; 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; ret = wc;
}else { }else {
ret = MSVCRT_WEOF; ret = MSVCRT_WEOF;
} }
MSVCRT__unlock_file(file);
return ret; return ret;
} }
......
...@@ -921,6 +921,7 @@ int __cdecl MSVCRT__fputc_nolock(int,MSVCRT_FILE*); ...@@ -921,6 +921,7 @@ int __cdecl MSVCRT__fputc_nolock(int,MSVCRT_FILE*);
int __cdecl MSVCRT_ungetc(int,MSVCRT_FILE*); int __cdecl MSVCRT_ungetc(int,MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*); MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT__fgetwc_nolock(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*); MSVCRT_wint_t __cdecl MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
int __cdecl MSVCRT__fseeki64_nolock(MSVCRT_FILE*,__int64,int); int __cdecl MSVCRT__fseeki64_nolock(MSVCRT_FILE*,__int64,int);
__int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file); __int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file);
......
...@@ -199,6 +199,7 @@ unsigned int __cdecl _set_output_format(void); ...@@ -199,6 +199,7 @@ unsigned int __cdecl _set_output_format(void);
#define _WSTDIO_DEFINED #define _WSTDIO_DEFINED
wint_t __cdecl _fgetwc_nolock(FILE*); wint_t __cdecl _fgetwc_nolock(FILE*);
wint_t __cdecl _fgetwchar(void); wint_t __cdecl _fgetwchar(void);
wint_t __cdecl _fputwc_nolock(wint_t,FILE*);
wint_t __cdecl _fputwchar(wint_t); wint_t __cdecl _fputwchar(wint_t);
wchar_t* __cdecl _getws(wchar_t*); wchar_t* __cdecl _getws(wchar_t*);
int __cdecl _putws(const wchar_t*); int __cdecl _putws(const wchar_t*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment