Commit f67f1ce7 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Remove non-needed defines from msvcrt.h.

parent 951968c8
......@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fcntl.h>
#include <math.h>
#include "msvcrt.h"
#include <winnls.h>
......@@ -276,7 +277,7 @@ int* CDECL __p__fmode(void) { return &MSVCRT__fmode; }
int CDECL _set_fmode(int mode)
{
/* TODO: support _O_WTEXT */
if(!MSVCRT_CHECK_PMT(mode==MSVCRT__O_TEXT || mode==MSVCRT__O_BINARY))
if(!MSVCRT_CHECK_PMT(mode==_O_TEXT || mode==_O_BINARY))
return EINVAL;
MSVCRT__fmode = mode;
......@@ -435,7 +436,7 @@ void msvcrt_init_args(void)
MSVCRT__HUGE = HUGE_VAL;
MSVCRT___setlc_active = 0;
MSVCRT___unguarded_readlc_active = 0;
MSVCRT__fmode = MSVCRT__O_TEXT;
MSVCRT__fmode = _O_TEXT;
MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(NULL);
MSVCRT___initenv = msvcrt_SnapshotOfEnvironmentA(NULL);
......
......@@ -50,8 +50,8 @@ static CRITICAL_SECTION MSVCRT_onexit_cs = { &MSVCRT_onexit_cs_debug, -1, 0, 0,
extern int MSVCRT_app_type;
extern wchar_t *MSVCRT__wpgmptr;
static unsigned int MSVCRT_abort_behavior = MSVCRT__WRITE_ABORT_MSG | MSVCRT__CALL_REPORTFAULT;
static int MSVCRT_error_mode = MSVCRT__OUT_TO_DEFAULT;
static unsigned int MSVCRT_abort_behavior = _WRITE_ABORT_MSG | _CALL_REPORTFAULT;
static int MSVCRT_error_mode = _OUT_TO_DEFAULT;
void (*CDECL _aexit_rtn)(int) = _exit;
......@@ -230,8 +230,8 @@ void CDECL _amsg_exit(int errnum)
{
TRACE("(%d)\n", errnum);
if ((MSVCRT_error_mode == MSVCRT__OUT_TO_MSGBOX) ||
((MSVCRT_error_mode == MSVCRT__OUT_TO_DEFAULT) && (MSVCRT_app_type == 2)))
if ((MSVCRT_error_mode == _OUT_TO_MSGBOX) ||
((MSVCRT_error_mode == _OUT_TO_DEFAULT) && (MSVCRT_app_type == 2)))
{
char text[32];
sprintf(text, "Error: R60%d",errnum);
......@@ -249,10 +249,10 @@ void CDECL abort(void)
{
TRACE("()\n");
if (MSVCRT_abort_behavior & MSVCRT__WRITE_ABORT_MSG)
if (MSVCRT_abort_behavior & _WRITE_ABORT_MSG)
{
if ((MSVCRT_error_mode == MSVCRT__OUT_TO_MSGBOX) ||
((MSVCRT_error_mode == MSVCRT__OUT_TO_DEFAULT) && (MSVCRT_app_type == 2)))
if ((MSVCRT_error_mode == _OUT_TO_MSGBOX) ||
((MSVCRT_error_mode == _OUT_TO_DEFAULT) && (MSVCRT_app_type == 2)))
{
DoMessageBox("Runtime error!", "abnormal program termination");
}
......@@ -273,7 +273,7 @@ unsigned int CDECL _set_abort_behavior(unsigned int flags, unsigned int mask)
unsigned int old = MSVCRT_abort_behavior;
TRACE("%x, %x\n", flags, mask);
if (mask & MSVCRT__CALL_REPORTFAULT)
if (mask & _CALL_REPORTFAULT)
FIXME("_WRITE_CALL_REPORTFAULT unhandled\n");
MSVCRT_abort_behavior = (MSVCRT_abort_behavior & ~mask) | (flags & mask);
......@@ -288,8 +288,8 @@ void CDECL _wassert(const wchar_t* str, const wchar_t* file, unsigned int line)
{
TRACE("(%s,%s,%d)\n", debugstr_w(str), debugstr_w(file), line);
if ((MSVCRT_error_mode == MSVCRT__OUT_TO_MSGBOX) ||
((MSVCRT_error_mode == MSVCRT__OUT_TO_DEFAULT) && (MSVCRT_app_type == 2)))
if ((MSVCRT_error_mode == _OUT_TO_MSGBOX) ||
((MSVCRT_error_mode == _OUT_TO_DEFAULT) && (MSVCRT_app_type == 2)))
{
wchar_t text[2048];
_snwprintf(text, sizeof(text), L"File: %ls\nLine: %d\n\nExpression: \"%ls\"", file, line, str);
......@@ -510,7 +510,7 @@ int CDECL _set_error_mode(int mode)
{
const int old = MSVCRT_error_mode;
if ( MSVCRT__REPORT_ERRMODE != mode ) {
if ( _REPORT_ERRMODE != mode ) {
MSVCRT_error_mode = mode;
}
return old;
......
......@@ -847,7 +847,7 @@ int CDECL strncpy_s(char *dest, size_t numberOfElements,
if (!MSVCRT_CHECK_PMT(src != NULL)) return EINVAL;
if (!MSVCRT_CHECK_PMT(numberOfElements != 0)) return EINVAL;
if(count!=MSVCRT__TRUNCATE && count<numberOfElements)
if(count!=_TRUNCATE && count<numberOfElements)
end = count;
else
end = numberOfElements-1;
......@@ -855,7 +855,7 @@ int CDECL strncpy_s(char *dest, size_t numberOfElements,
for(i=0; i<end && src[i]; i++)
dest[i] = src[i];
if(!src[i] || end==count || count==MSVCRT__TRUNCATE) {
if(!src[i] || end==count || count==_TRUNCATE) {
dest[i] = '\0';
return 0;
}
......
......@@ -2597,7 +2597,7 @@ int CDECL _mbstowcs_s_l(size_t *ret, wchar_t *wcstr,
return EINVAL;
}
if(count==MSVCRT__TRUNCATE || size<count)
if(count==_TRUNCATE || size<count)
conv = size;
else
conv = count;
......@@ -2605,7 +2605,7 @@ int CDECL _mbstowcs_s_l(size_t *ret, wchar_t *wcstr,
conv = _mbstowcs_l(wcstr, mbstr, conv, locale);
if(conv<size)
wcstr[conv++] = '\0';
else if(conv==size && count==MSVCRT__TRUNCATE && wcstr[conv-1]!='\0') {
else if(conv==size && count==_TRUNCATE && wcstr[conv-1]!='\0') {
wcstr[conv-1] = '\0';
err = STRUNCATE;
}else if(conv==size && wcstr[conv-1]!='\0') {
......
......@@ -59,7 +59,7 @@ int CDECL rand(void)
/* this is the algorithm used by MSVC, according to
* http://en.wikipedia.org/wiki/List_of_pseudorandom_number_generators */
data->random_seed = data->random_seed * 214013 + 2531011;
return (data->random_seed >> 16) & MSVCRT_RAND_MAX;
return (data->random_seed >> 16) & RAND_MAX;
}
/*********************************************************************
......@@ -406,7 +406,7 @@ unsigned int CDECL _set_output_format(unsigned int new_output_format)
{
unsigned int ret = output_format;
if(!MSVCRT_CHECK_PMT(new_output_format==0 || new_output_format==MSVCRT__TWO_DIGIT_EXPONENT))
if(!MSVCRT_CHECK_PMT(new_output_format==0 || new_output_format==_TWO_DIGIT_EXPONENT))
return ret;
output_format = new_output_format;
......
......@@ -283,91 +283,19 @@ extern unsigned msvcrt_create_io_inherit_block(WORD*, BYTE**) DECLSPEC_HIDDEN;
extern FILE MSVCRT__iob[];
#define MSVCRT_RAND_MAX 0x7fff
#define MSVCRT_NO_CONSOLE_FD (-2)
#define MSVCRT_NO_CONSOLE ((HANDLE)MSVCRT_NO_CONSOLE_FD)
#define MSVCRT_DRIVE_MAX 3
#define MSVCRT_FNAME_MAX 256
#define MSVCRT_DIR_MAX 256
#define MSVCRT_EXT_MAX 256
#define MSVCRT_PATH_MAX 260
#define MSVCRT_stdin (MSVCRT__iob+STDIN_FILENO)
#define MSVCRT_stdout (MSVCRT__iob+STDOUT_FILENO)
#define MSVCRT_stderr (MSVCRT__iob+STDERR_FILENO)
#define MSVCRT__P_WAIT 0
#define MSVCRT__P_NOWAIT 1
#define MSVCRT__P_OVERLAY 2
#define MSVCRT__P_NOWAITO 3
#define MSVCRT__P_DETACH 4
#define MSVCRT__OUT_TO_DEFAULT 0
#define MSVCRT__OUT_TO_STDERR 1
#define MSVCRT__OUT_TO_MSGBOX 2
#define MSVCRT__REPORT_ERRMODE 3
/* internal file._flag flags */
#define MSVCRT__USERBUF 0x0100
#define MSVCRT__IOCOMMIT 0x4000
#define MSVCRT__S_IEXEC 0x0040
#define MSVCRT__S_IWRITE 0x0080
#define MSVCRT__S_IREAD 0x0100
#define MSVCRT__S_IFIFO 0x1000
#define MSVCRT__S_IFCHR 0x2000
#define MSVCRT__S_IFDIR 0x4000
#define MSVCRT__S_IFREG 0x8000
#define MSVCRT__S_IFMT 0xF000
#define MSVCRT__LK_UNLCK 0
#define MSVCRT__LK_LOCK 1
#define MSVCRT__LK_NBLCK 2
#define MSVCRT__LK_RLCK 3
#define MSVCRT__LK_NBRLCK 4
#define MSVCRT__SH_COMPAT 0x00 /* Compatibility */
#define MSVCRT__SH_DENYRW 0x10 /* Deny read/write */
#define MSVCRT__SH_DENYWR 0x20 /* Deny write */
#define MSVCRT__SH_DENYRD 0x30 /* Deny read */
#define MSVCRT__SH_DENYNO 0x40 /* Deny nothing */
#define MSVCRT__O_RDONLY 0
#define MSVCRT__O_WRONLY 1
#define MSVCRT__O_RDWR 2
#define MSVCRT__O_ACCMODE (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
#define MSVCRT__O_APPEND 0x0008
#define MSVCRT__O_RANDOM 0x0010
#define MSVCRT__O_SEQUENTIAL 0x0020
#define MSVCRT__O_TEMPORARY 0x0040
#define MSVCRT__O_NOINHERIT 0x0080
#define MSVCRT__O_CREAT 0x0100
#define MSVCRT__O_TRUNC 0x0200
#define MSVCRT__O_EXCL 0x0400
#define MSVCRT__O_SHORT_LIVED 0x1000
#define MSVCRT__O_TEXT 0x4000
#define MSVCRT__O_BINARY 0x8000
#define MSVCRT__O_RAW MSVCRT__O_BINARY
#define MSVCRT__O_WTEXT 0x10000
#define MSVCRT__O_U16TEXT 0x20000
#define MSVCRT__O_U8TEXT 0x40000
#define MSVCRT_CLOCKS_PER_SEC 1000
#define MSVCRT__TRUNCATE ((size_t)-1)
#define _MAX__TIME64_T (((__time64_t)0x00000007 << 32) | 0x93406FFF)
/* _set_abort_behavior codes */
#define MSVCRT__WRITE_ABORT_MSG 1
#define MSVCRT__CALL_REPORTFAULT 2
/* _get_output_format return code */
#define MSVCRT__TWO_DIGIT_EXPONENT 0x1
#define MSVCRT__NLSCMPERROR ((unsigned int)0x7fffffff)
int __cdecl MSVCRT_iswdigit(wint_t);
int __cdecl MSVCRT__fgetc_nolock(FILE*);
......
......@@ -966,7 +966,7 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API
BOOL standard_rounding = options & _CRT_INTERNAL_PRINTF_STANDARD_ROUNDING;
#else
BOOL legacy_wide = TRUE, legacy_msvcrt_compat = TRUE;
BOOL three_digit_exp = _get_output_format() != MSVCRT__TWO_DIGIT_EXPONENT;
BOOL three_digit_exp = _get_output_format() != _TWO_DIGIT_EXPONENT;
BOOL standard_rounding = FALSE;
#endif
......
......@@ -27,6 +27,7 @@
* -No check for maximum path/argument/environment size is done
*/
#include <fcntl.h>
#include <io.h>
#include <process.h>
#include <stdarg.h>
......@@ -139,7 +140,7 @@ static intptr_t msvcrt_spawn(int flags, const wchar_t* exe, wchar_t* cmdline,
TRACE("%x %s %s %s %d\n", flags, debugstr_w(exe), debugstr_w(cmdline), debugstr_w(env), use_path);
if ((unsigned)flags > MSVCRT__P_DETACH)
if ((unsigned)flags > _P_DETACH)
{
*_errno() = EINVAL;
return -1;
......@@ -150,7 +151,7 @@ static intptr_t msvcrt_spawn(int flags, const wchar_t* exe, wchar_t* cmdline,
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
msvcrt_create_io_inherit_block(&si.cbReserved2, &si.lpReserved2);
if (flags == MSVCRT__P_DETACH) create_flags |= DETACHED_PROCESS;
if (flags == _P_DETACH) create_flags |= DETACHED_PROCESS;
if (!CreateProcessW(fullname, cmdline, NULL, NULL, TRUE,
create_flags, env, NULL, &si, &pi))
{
......@@ -162,21 +163,21 @@ static intptr_t msvcrt_spawn(int flags, const wchar_t* exe, wchar_t* cmdline,
free(si.lpReserved2);
switch(flags)
{
case MSVCRT__P_WAIT:
case _P_WAIT:
WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess,&pi.dwProcessId);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return pi.dwProcessId;
case MSVCRT__P_DETACH:
case _P_DETACH:
CloseHandle(pi.hProcess);
pi.hProcess = 0;
/* fall through */
case MSVCRT__P_NOWAIT:
case MSVCRT__P_NOWAITO:
case _P_NOWAIT:
case _P_NOWAITO:
CloseHandle(pi.hThread);
return (intptr_t)pi.hProcess;
case MSVCRT__P_OVERLAY:
case _P_OVERLAY:
_exit(0);
}
return -1; /* can't reach here */
......@@ -398,7 +399,7 @@ intptr_t WINAPIV _wexecl(const wchar_t* name, const wchar_t* arg0, ...)
args = msvcrt_valisttos(arg0, ap, ' ');
__ms_va_end(ap);
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, name, args, NULL, 0);
ret = msvcrt_spawn(_P_OVERLAY, name, args, NULL, 0);
free(args);
return ret;
......@@ -422,7 +423,7 @@ intptr_t WINAPIV _execl(const char* name, const char* arg0, ...)
args = msvcrt_valisttos_aw(arg0, ap, ' ');
__ms_va_end(ap);
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, nameW, args, NULL, 0);
ret = msvcrt_spawn(_P_OVERLAY, nameW, args, NULL, 0);
free(nameW);
free(args);
......@@ -451,7 +452,7 @@ intptr_t WINAPIV _wexecle(const wchar_t* name, const wchar_t* arg0, ...)
if (envp) envs = msvcrt_argvtos(envp, 0);
__ms_va_end(ap);
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, name, args, envs, 0);
ret = msvcrt_spawn(_P_OVERLAY, name, args, envs, 0);
free(args);
free(envs);
......@@ -480,7 +481,7 @@ intptr_t WINAPIV _execle(const char* name, const char* arg0, ...)
if (envp) envs = msvcrt_argvtos_aw(envp, 0);
__ms_va_end(ap);
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, nameW, args, envs, 0);
ret = msvcrt_spawn(_P_OVERLAY, nameW, args, envs, 0);
free(nameW);
free(args);
......@@ -503,7 +504,7 @@ intptr_t WINAPIV _wexeclp(const wchar_t* name, const wchar_t* arg0, ...)
args = msvcrt_valisttos(arg0, ap, ' ');
__ms_va_end(ap);
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, name, args, NULL, 1);
ret = msvcrt_spawn(_P_OVERLAY, name, args, NULL, 1);
free(args);
return ret;
......@@ -527,7 +528,7 @@ intptr_t WINAPIV _execlp(const char* name, const char* arg0, ...)
args = msvcrt_valisttos_aw(arg0, ap, ' ');
__ms_va_end(ap);
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, nameW, args, NULL, 1);
ret = msvcrt_spawn(_P_OVERLAY, nameW, args, NULL, 1);
free(nameW);
free(args);
......@@ -556,7 +557,7 @@ intptr_t WINAPIV _wexeclpe(const wchar_t* name, const wchar_t* arg0, ...)
if (envp) envs = msvcrt_argvtos(envp, 0);
__ms_va_end(ap);
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, name, args, envs, 1);
ret = msvcrt_spawn(_P_OVERLAY, name, args, envs, 1);
free(args);
free(envs);
......@@ -585,7 +586,7 @@ intptr_t WINAPIV _execlpe(const char* name, const char* arg0, ...)
if (envp) envs = msvcrt_argvtos_aw(envp, 0);
__ms_va_end(ap);
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, nameW, args, envs, 1);
ret = msvcrt_spawn(_P_OVERLAY, nameW, args, envs, 1);
free(nameW);
free(args);
......@@ -600,7 +601,7 @@ intptr_t WINAPIV _execlpe(const char* name, const char* arg0, ...)
*/
intptr_t CDECL _wexecv(const wchar_t* name, const wchar_t* const* argv)
{
return _wspawnve(MSVCRT__P_OVERLAY, name, argv, NULL);
return _wspawnve(_P_OVERLAY, name, argv, NULL);
}
/*********************************************************************
......@@ -611,7 +612,7 @@ intptr_t CDECL _wexecv(const wchar_t* name, const wchar_t* const* argv)
*/
intptr_t CDECL _execv(const char* name, const char* const* argv)
{
return _spawnve(MSVCRT__P_OVERLAY, name, argv, NULL);
return _spawnve(_P_OVERLAY, name, argv, NULL);
}
/*********************************************************************
......@@ -621,7 +622,7 @@ intptr_t CDECL _execv(const char* name, const char* const* argv)
*/
intptr_t CDECL _wexecve(const wchar_t* name, const wchar_t* const* argv, const wchar_t* const* envv)
{
return _wspawnve(MSVCRT__P_OVERLAY, name, argv, envv);
return _wspawnve(_P_OVERLAY, name, argv, envv);
}
/*********************************************************************
......@@ -632,7 +633,7 @@ intptr_t CDECL _wexecve(const wchar_t* name, const wchar_t* const* argv, const w
*/
intptr_t CDECL _execve(const char* name, const char* const* argv, const char* const* envv)
{
return _spawnve(MSVCRT__P_OVERLAY, name, argv, envv);
return _spawnve(_P_OVERLAY, name, argv, envv);
}
/*********************************************************************
......@@ -642,7 +643,7 @@ intptr_t CDECL _execve(const char* name, const char* const* argv, const char* co
*/
intptr_t CDECL _wexecvpe(const wchar_t* name, const wchar_t* const* argv, const wchar_t* const* envv)
{
return _wspawnvpe(MSVCRT__P_OVERLAY, name, argv, envv);
return _wspawnvpe(_P_OVERLAY, name, argv, envv);
}
/*********************************************************************
......@@ -653,7 +654,7 @@ intptr_t CDECL _wexecvpe(const wchar_t* name, const wchar_t* const* argv, const
*/
intptr_t CDECL _execvpe(const char* name, const char* const* argv, const char* const* envv)
{
return _spawnvpe(MSVCRT__P_OVERLAY, name, argv, envv);
return _spawnvpe(_P_OVERLAY, name, argv, envv);
}
/*********************************************************************
......@@ -1054,7 +1055,7 @@ FILE* CDECL _wpopen(const wchar_t* command, const wchar_t* mode)
return NULL;
_get_fmode(&fmode);
textmode = fmode & (MSVCRT__O_BINARY | MSVCRT__O_TEXT);
textmode = fmode & (_O_BINARY | _O_TEXT);
for (p = mode; *p; p++)
{
switch (*p)
......@@ -1065,13 +1066,13 @@ FILE* CDECL _wpopen(const wchar_t* command, const wchar_t* mode)
break;
case 'B':
case 'b':
textmode |= MSVCRT__O_BINARY;
textmode &= ~MSVCRT__O_TEXT;
textmode |= _O_BINARY;
textmode &= ~_O_TEXT;
break;
case 'T':
case 't':
textmode |= MSVCRT__O_TEXT;
textmode &= ~MSVCRT__O_BINARY;
textmode |= _O_TEXT;
textmode &= ~_O_BINARY;
break;
}
}
......@@ -1120,7 +1121,7 @@ FILE* CDECL _wpopen(const wchar_t* command, const wchar_t* mode)
wcscat(fullcmd, L" /c ");
wcscat(fullcmd, command);
if ((container->proc = (HANDLE)msvcrt_spawn(MSVCRT__P_NOWAIT, comspec, fullcmd, NULL, 1))
if ((container->proc = (HANDLE)msvcrt_spawn(_P_NOWAIT, comspec, fullcmd, NULL, 1))
== INVALID_HANDLE_VALUE)
{
_close(fds[fdToOpen]);
......@@ -1252,7 +1253,7 @@ int CDECL _wsystem(const wchar_t* cmd)
wcscat(fullcmd, L" /c ");
wcscat(fullcmd, cmd);
res = msvcrt_spawn(MSVCRT__P_WAIT, comspec, fullcmd, NULL, 1);
res = msvcrt_spawn(_P_WAIT, comspec, fullcmd, NULL, 1);
HeapFree(GetProcessHeap(), 0, comspec);
HeapFree(GetProcessHeap(), 0, fullcmd);
......
......@@ -1350,7 +1350,7 @@ int CDECL strncat_s( char* dst, size_t elem, const char* src, size_t count )
{
for(j = 0; (j + i) < elem; j++)
{
if(count == MSVCRT__TRUNCATE && j + i == elem - 1)
if(count == _TRUNCATE && j + i == elem - 1)
{
dst[j + i] = '\0';
return STRUNCATE;
......@@ -2656,7 +2656,7 @@ int __cdecl _strnicmp_l(const char *s1, const char *s2,
int c1, c2;
if(s1==NULL || s2==NULL)
return MSVCRT__NLSCMPERROR;
return _NLSCMPERROR;
if(!count)
return 0;
......@@ -2766,7 +2766,7 @@ int __cdecl _memicmp_l(const void *v1, const void *v2, size_t len, _locale_t loc
{
if (len)
MSVCRT_INVALID_PMT(NULL, EINVAL);
return len ? MSVCRT__NLSCMPERROR : 0;
return len ? _NLSCMPERROR : 0;
}
#endif
......
......@@ -666,7 +666,7 @@ clock_t CDECL clock(void)
LARGE_INTEGER systime;
NtQuerySystemTime(&systime);
return (systime.QuadPart - init_time) / (TICKSPERSEC / MSVCRT_CLOCKS_PER_SEC);
return (systime.QuadPart - init_time) / (TICKSPERSEC / CLOCKS_PER_SEC);
}
/*********************************************************************
......@@ -1381,7 +1381,7 @@ static size_t strftime_impl(STRFTIME_CHAR *str, size_t max,
#else
if(_mbstowcs_s_l(&tmp, str+ret, max-ret,
mstm->tm_isdst ? tzname_dst : tzname_std,
MSVCRT__TRUNCATE, loc) == STRUNCATE)
_TRUNCATE, loc) == STRUNCATE)
ret = max;
#endif
ret += tmp-1;
......
......@@ -124,7 +124,7 @@ INT CDECL _wcsicmp_l(const wchar_t *str1, const wchar_t *str2, _locale_t locale)
wchar_t c1, c2;
if(!MSVCRT_CHECK_PMT(str1 != NULL) || !MSVCRT_CHECK_PMT(str2 != NULL))
return MSVCRT__NLSCMPERROR;
return _NLSCMPERROR;
if(!locale)
locale = get_current_locale_noalloc(&tmp);
......@@ -170,7 +170,7 @@ INT CDECL _wcsnicmp_l(const wchar_t *str1, const wchar_t *str2,
return 0;
if(!MSVCRT_CHECK_PMT(str1 != NULL) || !MSVCRT_CHECK_PMT(str2 != NULL))
return MSVCRT__NLSCMPERROR;
return _NLSCMPERROR;
if(!locale)
locale = get_current_locale_noalloc(&tmp);
......@@ -703,7 +703,7 @@ static int wcsrtombs_s_l(size_t *ret, char *mbstr, size_t size,
if (!MSVCRT_CHECK_PMT(wcstr != NULL)) return EINVAL;
if (!MSVCRT_CHECK_PMT(*wcstr != NULL)) return EINVAL;
if(count==MSVCRT__TRUNCATE || size<count)
if(count==_TRUNCATE || size<count)
conv = size;
else
conv = count;
......@@ -717,9 +717,9 @@ static int wcsrtombs_s_l(size_t *ret, char *mbstr, size_t size,
err = *_errno();
}else if(conv < size)
mbstr[conv++] = '\0';
else if(conv==size && (count==MSVCRT__TRUNCATE || mbstr[conv-1]=='\0')) {
else if(conv==size && (count==_TRUNCATE || mbstr[conv-1]=='\0')) {
mbstr[conv-1] = '\0';
if(count==MSVCRT__TRUNCATE)
if(count==_TRUNCATE)
err = STRUNCATE;
}else {
MSVCRT_INVALID_PMT("mbstr[size] is too small", ERANGE);
......@@ -969,7 +969,7 @@ static int CDECL vsnprintf_s_l_opt( char *str, size_t sizeOfBuffer,
puts_clbk_str_a(&ctx, 1, &nullbyte);
if(ret<0 || ret==len) {
if(count!=MSVCRT__TRUNCATE && count>sizeOfBuffer) {
if(count!=_TRUNCATE && count>sizeOfBuffer) {
MSVCRT_INVALID_PMT("str[sizeOfBuffer] is too small", ERANGE);
memset(str, 0, sizeOfBuffer);
} else
......@@ -999,7 +999,7 @@ static int vsnwprintf_s_l_opt( wchar_t *str, size_t sizeOfBuffer,
puts_clbk_str_w(&ctx, 1, L"");
if(ret<0 || ret==len) {
if(count!=MSVCRT__TRUNCATE && count>sizeOfBuffer) {
if(count!=_TRUNCATE && count>sizeOfBuffer) {
MSVCRT_INVALID_PMT("str[sizeOfBuffer] is too small", ERANGE);
memset(str, 0, sizeOfBuffer*sizeof(wchar_t));
} else
......@@ -2348,7 +2348,7 @@ INT CDECL wcsncpy_s( wchar_t* wcDest, size_t numElement, const wchar_t *wcSrc,
size_t count )
{
WCHAR *p = wcDest;
BOOL truncate = (count == MSVCRT__TRUNCATE);
BOOL truncate = (count == _TRUNCATE);
if(!wcDest && !numElement && !count)
return 0;
......@@ -2447,7 +2447,7 @@ INT CDECL wcsncat_s(wchar_t *dst, size_t elem,
return EINVAL;
}
if (count == MSVCRT__TRUNCATE)
if (count == _TRUNCATE)
{
srclen = wcslen(src);
if (srclen >= (elem - dststart))
......
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