Commit 8180f400 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Use EOF from public header.

parent 7acfe8fb
......@@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
static HANDLE MSVCRT_console_in = INVALID_HANDLE_VALUE;
static HANDLE MSVCRT_console_out= INVALID_HANDLE_VALUE;
static int __MSVCRT_console_buffer = MSVCRT_EOF;
static int __MSVCRT_console_buffer = EOF;
static wchar_t __MSVCRT_console_buffer_w = WEOF;
/* INTERNAL: Initialise console handles */
......@@ -153,12 +153,12 @@ static BOOL handle_enhanced_keys(INPUT_RECORD *ir, unsigned char *ch1, unsigned
*/
int CDECL _getch_nolock(void)
{
int retval = MSVCRT_EOF;
int retval = EOF;
if (__MSVCRT_console_buffer != MSVCRT_EOF)
if (__MSVCRT_console_buffer != EOF)
{
retval = __MSVCRT_console_buffer;
__MSVCRT_console_buffer = MSVCRT_EOF;
__MSVCRT_console_buffer = EOF;
}
else
{
......@@ -290,7 +290,7 @@ int CDECL _putch_nolock(int c)
DWORD count;
if (WriteConsoleA(MSVCRT_console_out, &c, 1, &count, NULL) && count == 1)
return c;
return MSVCRT_EOF;
return EOF;
}
/*********************************************************************
......@@ -333,7 +333,7 @@ int CDECL _getche_nolock(void)
{
int retval;
retval = _getch_nolock();
if (retval != MSVCRT_EOF)
if (retval != EOF)
retval = _putch_nolock(retval);
return retval;
}
......@@ -419,8 +419,8 @@ char* CDECL _cgets(char* str)
*/
int CDECL _ungetch_nolock(int c)
{
int retval = MSVCRT_EOF;
if (c != MSVCRT_EOF && __MSVCRT_console_buffer == MSVCRT_EOF)
int retval = EOF;
if (c != EOF && __MSVCRT_console_buffer == EOF)
retval = __MSVCRT_console_buffer = c;
return retval;
}
......@@ -466,7 +466,7 @@ int CDECL _kbhit(void)
int retval = 0;
LOCK_CONSOLE;
if (__MSVCRT_console_buffer != MSVCRT_EOF)
if (__MSVCRT_console_buffer != EOF)
retval = 1;
else
{
......
......@@ -2444,7 +2444,7 @@ wint_t CDECL btowc(int c)
unsigned char letter = c;
wchar_t ret;
if(c == MSVCRT_EOF)
if(c == EOF)
return WEOF;
if(!get_locinfo()->lc_codepage)
return c & 255;
......
......@@ -555,7 +555,6 @@ struct MSVCRT__stat64 {
#define MSVCRT__stati64 MSVCRT__stat32i64
#endif
#define MSVCRT_EOF (-1)
#define MSVCRT_TMP_MAX 0x7fff
#define MSVCRT_TMP_MAX_S 0x7fffffff
#define MSVCRT_RAND_MAX 0x7fff
......
......@@ -34,8 +34,8 @@
#define _BITMAPSIZE_ 256*256
#else /* WIDE_SCANF */
#define _CHAR_ char
#define _EOF_ MSVCRT_EOF
#define _EOF_RET MSVCRT_EOF
#define _EOF_ EOF
#define _EOF_RET EOF
#define _ISSPACE_(c) MSVCRT_isspace(c)
#define _WIDE2SUPPORTED_(c) c /* FIXME: convert wide char to char */
#define _CHAR2SUPPORTED_(c) c /* No conversion needed (char to char) */
......
......@@ -2039,10 +2039,10 @@ INT CDECL MSVCRT_wctob( wint_t wchar )
if (wchar < 0xff)
return (signed char)wchar;
else
return MSVCRT_EOF;
return EOF;
} else if(WideCharToMultiByte( codepage, 0, &wchar, 1, &out, 1, NULL, perror ) && !error)
return (INT)out;
return MSVCRT_EOF;
return EOF;
}
/*********************************************************************
......
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