=?UTF-8?Q?Iv=C3=A1n=20Matellanes=20?=: msvcrt: Added _fgetwc_nolock implementation.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Oct 31 02:53:36 CDT 2014
Module: wine
Branch: master
Commit: 156684ba91e165dce614a8da94080a5c1f88d62d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=156684ba91e165dce614a8da94080a5c1f88d62d
Author: Iván Matellanes <matellanesivan at gmail.com>
Date: Tue Oct 28 14:43:47 2014 +0100
msvcrt: Added _fgetwc_nolock implementation.
---
dlls/msvcr100/msvcr100.spec | 2 +-
dlls/msvcr110/msvcr110.spec | 2 +-
dlls/msvcr80/msvcr80.spec | 2 +-
dlls/msvcr90/msvcr90.spec | 2 +-
dlls/msvcrt/file.c | 21 ++++++++++++++++-----
dlls/msvcrt/msvcrt.h | 1 +
include/msvcrt/stdio.h | 1 +
7 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index e33f5fe..80d5bc9 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -802,7 +802,7 @@
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
-@ stub _fgetwc_nolock
+@ cdecl _fgetwc_nolock(ptr) MSVCRT__fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar
@ cdecl _filbuf(ptr) MSVCRT__filbuf
@ cdecl _filelength(long) MSVCRT__filelength
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index 88144a3..283f5fd 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -1150,7 +1150,7 @@
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
-@ stub _fgetwc_nolock
+@ cdecl _fgetwc_nolock(ptr) MSVCRT__fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar
@ cdecl _filbuf(ptr) MSVCRT__filbuf
@ cdecl _filelength(long) MSVCRT__filelength
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index 5c01600..a48e42b 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -469,7 +469,7 @@
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
-@ stub _fgetwc_nolock
+@ cdecl _fgetwc_nolock(ptr) MSVCRT__fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar
@ cdecl _filbuf(ptr) MSVCRT__filbuf
@ cdecl _filelength(long) MSVCRT__filelength
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index d9d99f4..e9abf00 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -451,7 +451,7 @@
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
-@ stub _fgetwc_nolock
+@ cdecl _fgetwc_nolock(ptr) MSVCRT__fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar
@ cdecl _filbuf(ptr) MSVCRT__filbuf
@ cdecl _filelength(long) MSVCRT__filelength
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index dbbbe78..fe3525c 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -3576,16 +3576,28 @@ char * CDECL MSVCRT_fgets(char *s, int size, MSVCRT_FILE* file)
MSVCRT_wint_t CDECL MSVCRT_fgetwc(MSVCRT_FILE* file)
{
MSVCRT_wint_t ret;
- int ch;
MSVCRT__lock_file(file);
+ ret = MSVCRT__fgetwc_nolock(file);
+ MSVCRT__unlock_file(file);
+
+ return ret;
+}
+
+/*********************************************************************
+ * _fgetwc_nolock (MSVCRT.@)
+ */
+MSVCRT_wint_t CDECL MSVCRT__fgetwc_nolock(MSVCRT_FILE* file)
+{
+ MSVCRT_wint_t ret;
+ int ch;
if((msvcrt_get_ioinfo(file->_file)->exflag & (EF_UTF8 | EF_UTF16))
|| !(msvcrt_get_ioinfo(file->_file)->wxflag & WX_TEXT)) {
char *p;
for(p=(char*)&ret; (MSVCRT_wint_t*)p<&ret+1; p++) {
- ch = MSVCRT_fgetc(file);
+ ch = MSVCRT__fgetc_nolock(file);
if(ch == MSVCRT_EOF) {
ret = MSVCRT_WEOF;
break;
@@ -3596,11 +3608,11 @@ MSVCRT_wint_t CDECL MSVCRT_fgetwc(MSVCRT_FILE* file)
char mbs[MSVCRT_MB_LEN_MAX];
int len = 0;
- ch = MSVCRT_fgetc(file);
+ ch = MSVCRT__fgetc_nolock(file);
if(ch != MSVCRT_EOF) {
mbs[0] = (char)ch;
if(MSVCRT_isleadbyte((unsigned char)mbs[0])) {
- ch = MSVCRT_fgetc(file);
+ ch = MSVCRT__fgetc_nolock(file);
if(ch != MSVCRT_EOF) {
mbs[1] = (char)ch;
len = 2;
@@ -3614,7 +3626,6 @@ MSVCRT_wint_t CDECL MSVCRT_fgetwc(MSVCRT_FILE* file)
ret = MSVCRT_WEOF;
}
- MSVCRT__unlock_file(file);
return ret;
}
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index 137bec2..256a90c 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -919,6 +919,7 @@ int __cdecl MSVCRT_fgetc(MSVCRT_FILE*);
int __cdecl MSVCRT__fgetc_nolock(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_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
int __cdecl MSVCRT__fseeki64_nolock(MSVCRT_FILE*,__int64,int);
__int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file);
diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h
index 54c07fe..768b3a0 100644
--- a/include/msvcrt/stdio.h
+++ b/include/msvcrt/stdio.h
@@ -196,6 +196,7 @@ unsigned int __cdecl _set_output_format(void);
#ifndef _WSTDIO_DEFINED
#define _WSTDIO_DEFINED
+wint_t __cdecl _fgetwc_nolock(FILE*);
wint_t __cdecl _fgetwchar(void);
wint_t __cdecl _fputwchar(wint_t);
wchar_t* __cdecl _getws(wchar_t*);
More information about the wine-cvs
mailing list