msvcr: Add _ungetch_nolock implementation.

oldstable
Piotr Caban 2015-06-11 17:54:44 +02:00 committed by Alexandre Julliard
parent 57754bdb29
commit 853d4343db
6 changed files with 20 additions and 11 deletions

View File

@ -1410,7 +1410,7 @@
@ stub _umask_s
@ cdecl _ungetc_nolock(long ptr) MSVCRT__ungetc_nolock
@ cdecl _ungetch(long)
@ stub _ungetch_nolock
@ cdecl _ungetch_nolock(long)
@ cdecl _ungetwc_nolock(long ptr) MSVCRT__ungetwc_nolock
@ stub _ungetwch
@ stub _ungetwch_nolock

View File

@ -1768,7 +1768,7 @@
@ stub _umask_s
@ cdecl _ungetc_nolock(long ptr) MSVCRT__ungetc_nolock
@ cdecl _ungetch(long)
@ stub _ungetch_nolock
@ cdecl _ungetch_nolock(long)
@ cdecl _ungetwc_nolock(long ptr) MSVCRT__ungetwc_nolock
@ stub _ungetwch
@ stub _ungetwch_nolock

View File

@ -1782,7 +1782,7 @@
@ stub _umask_s
@ cdecl _ungetc_nolock(long ptr) MSVCRT__ungetc_nolock
@ cdecl _ungetch(long)
@ stub _ungetch_nolock
@ cdecl _ungetch_nolock(long)
@ cdecl _ungetwc_nolock(long ptr) MSVCRT__ungetwc_nolock
@ stub _ungetwch
@ stub _ungetwch_nolock

View File

@ -1090,7 +1090,7 @@
@ stub _umask_s
@ cdecl _ungetc_nolock(long ptr) MSVCRT__ungetc_nolock
@ cdecl _ungetch(long)
@ stub _ungetch_nolock
@ cdecl _ungetch_nolock(long)
@ cdecl _ungetwc_nolock(long ptr) MSVCRT__ungetwc_nolock
@ stub _ungetwch
@ stub _ungetwch_nolock

View File

@ -1065,7 +1065,7 @@
@ stub _umask_s
@ cdecl _ungetc_nolock(long ptr) MSVCRT__ungetc_nolock
@ cdecl _ungetch(long)
@ stub _ungetch_nolock
@ cdecl _ungetch_nolock(long)
@ cdecl _ungetwc_nolock(long ptr) MSVCRT__ungetwc_nolock
@ stub _ungetwch
@ stub _ungetwch_nolock

View File

@ -279,17 +279,26 @@ char* CDECL _cgets(char* str)
return buf;
}
/*********************************************************************
* _ungetch_nolock (MSVCRT.@)
*/
int CDECL _ungetch_nolock(int c)
{
int retval = MSVCRT_EOF;
if (c != MSVCRT_EOF && __MSVCRT_console_buffer == MSVCRT_EOF)
retval = __MSVCRT_console_buffer = c;
return retval;
}
/*********************************************************************
* _ungetch (MSVCRT.@)
*/
int CDECL _ungetch(int c)
{
int retval = MSVCRT_EOF;
LOCK_CONSOLE;
if (c != MSVCRT_EOF && __MSVCRT_console_buffer == MSVCRT_EOF)
retval = __MSVCRT_console_buffer = c;
UNLOCK_CONSOLE;
return retval;
LOCK_CONSOLE;
c = _ungetch_nolock(c);
UNLOCK_CONSOLE;
return c;
}
/*********************************************************************