Commit d66b9f7e authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Use the correct msvcrt defines for errno values.

parent a470afca
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "msvcrt.h" #include "msvcrt.h"
#include "mtdll.h" #include "mtdll.h"
#include "msvcrt/errno.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "msvcrt/mbctype.h" #include "msvcrt/mbctype.h"
#include "msvcrt/errno.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
...@@ -454,11 +453,11 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha ...@@ -454,11 +453,11 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha
MSVCRT_size_t pos = 0; MSVCRT_size_t pos = 0;
if(!dst || size == 0) if(!dst || size == 0)
return EINVAL; return MSVCRT_EINVAL;
if(!src) if(!src)
{ {
dst[0] = '\0'; dst[0] = '\0';
return EINVAL; return MSVCRT_EINVAL;
} }
if(!n) if(!n)
return 0; return 0;
...@@ -471,7 +470,7 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha ...@@ -471,7 +470,7 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha
if(pos == size) if(pos == size)
{ {
dst[0] = '\0'; dst[0] = '\0';
return ERANGE; return MSVCRT_ERANGE;
} }
is_lead = (!is_lead && _ismbblead(*src)); is_lead = (!is_lead && _ismbblead(*src));
n--; n--;
...@@ -489,7 +488,7 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha ...@@ -489,7 +488,7 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha
if(pos == size) if(pos == size)
{ {
dst[0] = '\0'; dst[0] = '\0';
return ERANGE; return MSVCRT_ERANGE;
} }
if(!(*src)) break; if(!(*src)) break;
...@@ -502,7 +501,7 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha ...@@ -502,7 +501,7 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha
else else
{ {
dst[0] = '\0'; dst[0] = '\0';
return ERANGE; return MSVCRT_ERANGE;
} }
return 0; return 0;
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <stdlib.h> #include <stdlib.h>
#include "msvcrt.h" #include "msvcrt.h"
#include "msvcrt/errno.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
...@@ -159,12 +158,12 @@ int CDECL MSVCRT_strcoll( const char* str1, const char* str2 ) ...@@ -159,12 +158,12 @@ int CDECL MSVCRT_strcoll( const char* str1, const char* str2 )
int CDECL MSVCRT_strcpy_s( char* dst, MSVCRT_size_t elem, const char* src ) int CDECL MSVCRT_strcpy_s( char* dst, MSVCRT_size_t elem, const char* src )
{ {
MSVCRT_size_t i; MSVCRT_size_t i;
if(!elem) return EINVAL; if(!elem) return MSVCRT_EINVAL;
if(!dst) return EINVAL; if(!dst) return MSVCRT_EINVAL;
if(!src) if(!src)
{ {
dst[0] = '\0'; dst[0] = '\0';
return EINVAL; return MSVCRT_EINVAL;
} }
for(i = 0; i < elem; i++) for(i = 0; i < elem; i++)
...@@ -172,7 +171,7 @@ int CDECL MSVCRT_strcpy_s( char* dst, MSVCRT_size_t elem, const char* src ) ...@@ -172,7 +171,7 @@ int CDECL MSVCRT_strcpy_s( char* dst, MSVCRT_size_t elem, const char* src )
if((dst[i] = src[i]) == '\0') return 0; if((dst[i] = src[i]) == '\0') return 0;
} }
dst[0] = '\0'; dst[0] = '\0';
return ERANGE; return MSVCRT_ERANGE;
} }
/********************************************************************* /*********************************************************************
...@@ -181,12 +180,12 @@ int CDECL MSVCRT_strcpy_s( char* dst, MSVCRT_size_t elem, const char* src ) ...@@ -181,12 +180,12 @@ int CDECL MSVCRT_strcpy_s( char* dst, MSVCRT_size_t elem, const char* src )
int CDECL MSVCRT_strcat_s( char* dst, MSVCRT_size_t elem, const char* src ) int CDECL MSVCRT_strcat_s( char* dst, MSVCRT_size_t elem, const char* src )
{ {
MSVCRT_size_t i, j; MSVCRT_size_t i, j;
if(!dst) return EINVAL; if(!dst) return MSVCRT_EINVAL;
if(elem == 0) return EINVAL; if(elem == 0) return MSVCRT_EINVAL;
if(!src) if(!src)
{ {
dst[0] = '\0'; dst[0] = '\0';
return EINVAL; return MSVCRT_EINVAL;
} }
for(i = 0; i < elem; i++) for(i = 0; i < elem; i++)
...@@ -201,7 +200,7 @@ int CDECL MSVCRT_strcat_s( char* dst, MSVCRT_size_t elem, const char* src ) ...@@ -201,7 +200,7 @@ int CDECL MSVCRT_strcat_s( char* dst, MSVCRT_size_t elem, const char* src )
} }
/* Set the first element to 0, not the first element after the skipped part */ /* Set the first element to 0, not the first element after the skipped part */
dst[0] = '\0'; dst[0] = '\0';
return ERANGE; return MSVCRT_ERANGE;
} }
/********************************************************************* /*********************************************************************
......
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