msvcrt: Added _wtol_l implementation.
This commit is contained in:
parent
5c03a35f7a
commit
06c6773844
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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.@)
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue