msvcrt: Added _wtol_l implementation.

This commit is contained in:
Piotr Caban 2013-03-27 16:11:32 +01:00 committed by Alexandre Julliard
parent 5c03a35f7a
commit 06c6773844
3 changed files with 28 additions and 2 deletions

View File

@ -42,6 +42,7 @@
#include "winbase.h" #include "winbase.h"
#define MSVCRT_LONG_MAX 0x7fffffffL #define MSVCRT_LONG_MAX 0x7fffffffL
#define MSVCRT_LONG_MIN (-MSVCRT_LONG_MAX-1)
#define MSVCRT_ULONG_MAX 0xffffffffUL #define MSVCRT_ULONG_MAX 0xffffffffUL
#define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff) #define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff)
#define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1) #define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1)

View File

@ -1226,8 +1226,8 @@
@ cdecl -ret64 _wtoi64(wstr) ntdll._wtoi64 @ cdecl -ret64 _wtoi64(wstr) ntdll._wtoi64
# stub -ret64 _wtoi64_l(wstr ptr) # stub -ret64 _wtoi64_l(wstr ptr)
@ cdecl _wtoi_l(wstr ptr) MSVCRT__wtoi_l @ cdecl _wtoi_l(wstr ptr) MSVCRT__wtoi_l
@ cdecl _wtol(wstr) ntdll._wtol @ cdecl _wtol(wstr) MSVCRT__wtol
# stub _wtol_l(wstr ptr) @ cdecl _wtol_l(wstr ptr) MSVCRT__wtol_l
@ cdecl _wunlink(wstr) MSVCRT__wunlink @ cdecl _wunlink(wstr) MSVCRT__wunlink
@ cdecl _wutime(wstr ptr) @ cdecl _wutime(wstr ptr)
@ cdecl _wutime32(wstr ptr) @ cdecl _wutime32(wstr ptr)

View File

@ -1471,6 +1471,31 @@ int __cdecl MSVCRT__wtoi(const MSVCRT_wchar_t *str)
return MSVCRT__wtoi_l(str, NULL); return MSVCRT__wtoi_l(str, NULL);
} }
/*********************************************************************
* _wtol_l (MSVCRT.@)
*/
MSVCRT_long __cdecl MSVCRT__wtol_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale)
{
__int64 ret = MSVCRT__wcstoi64_l(str, NULL, 10, locale);
if(ret > MSVCRT_LONG_MAX) {
ret = MSVCRT_LONG_MAX;
*MSVCRT__errno() = MSVCRT_ERANGE;
} else if(ret < MSVCRT_LONG_MIN) {
ret = MSVCRT_LONG_MIN;
*MSVCRT__errno() = MSVCRT_ERANGE;
}
return ret;
}
/*********************************************************************
* _wtol (MSVCRT.@)
*/
MSVCRT_long __cdecl MSVCRT__wtol(const MSVCRT_wchar_t *str)
{
return MSVCRT__wtol_l(str, NULL);
}
/********************************************************************* /*********************************************************************
* _wcstoui64_l (MSVCRT.@) * _wcstoui64_l (MSVCRT.@)
* *