Commit 06c67738 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Added _wtol_l implementation.

parent 5c03a35f
......@@ -42,6 +42,7 @@
#include "winbase.h"
#define MSVCRT_LONG_MAX 0x7fffffffL
#define MSVCRT_LONG_MIN (-MSVCRT_LONG_MAX-1)
#define MSVCRT_ULONG_MAX 0xffffffffUL
#define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff)
#define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1)
......
......@@ -1226,8 +1226,8 @@
@ cdecl -ret64 _wtoi64(wstr) ntdll._wtoi64
# stub -ret64 _wtoi64_l(wstr ptr)
@ cdecl _wtoi_l(wstr ptr) MSVCRT__wtoi_l
@ cdecl _wtol(wstr) ntdll._wtol
# stub _wtol_l(wstr ptr)
@ cdecl _wtol(wstr) MSVCRT__wtol
@ cdecl _wtol_l(wstr ptr) MSVCRT__wtol_l
@ cdecl _wunlink(wstr) MSVCRT__wunlink
@ cdecl _wutime(wstr ptr)
@ cdecl _wutime32(wstr ptr)
......
......@@ -1472,6 +1472,31 @@ int __cdecl MSVCRT__wtoi(const MSVCRT_wchar_t *str)
}
/*********************************************************************
* _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.@)
*
* FIXME: locale parameter is ignored
......
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