msvcr120: Add wcstof implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
78716aebf8
commit
4ee316a997
|
@ -51,7 +51,7 @@
|
|||
@ cdecl _ultow(long ptr long) ucrtbase._ultow
|
||||
@ cdecl _ultow_s(long ptr long long) ucrtbase._ultow_s
|
||||
@ cdecl _wcstod_l(wstr ptr) ucrtbase._wcstod_l
|
||||
@ stub _wcstof_l
|
||||
@ cdecl _wcstof_l(wstr ptr ptr) ucrtbase._wcstof_l
|
||||
@ cdecl -ret64 _wcstoi64(wstr ptr long) ucrtbase._wcstoi64
|
||||
@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) ucrtbase._wcstoi64_l
|
||||
@ stub _wcstoimax_l
|
||||
|
@ -106,7 +106,7 @@
|
|||
@ cdecl wcsrtombs(ptr ptr long ptr) ucrtbase.wcsrtombs
|
||||
@ cdecl wcsrtombs_s(ptr ptr long ptr long ptr) ucrtbase.wcsrtombs_s
|
||||
@ cdecl wcstod(wstr ptr) ucrtbase.wcstod
|
||||
@ stub wcstof
|
||||
@ cdecl wcstof(ptr ptr) ucrtbase.wcstof
|
||||
@ stub wcstoimax
|
||||
@ cdecl wcstol(wstr ptr long) ucrtbase.wcstol
|
||||
@ stub wcstold
|
||||
|
|
|
@ -1888,7 +1888,7 @@
|
|||
@ cdecl _wcsset(wstr long) MSVCRT__wcsset
|
||||
@ cdecl _wcsset_s(wstr long long) MSVCRT__wcsset_s
|
||||
@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
|
||||
@ stub _wcstof_l
|
||||
@ cdecl _wcstof_l(wstr ptr ptr) MSVCRT__wcstof_l
|
||||
@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64
|
||||
@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l
|
||||
@ stub _wcstoimax_l
|
||||
|
@ -2470,7 +2470,7 @@
|
|||
@ cdecl wcsspn(wstr wstr) ntdll.wcsspn
|
||||
@ cdecl wcsstr(wstr wstr) MSVCRT_wcsstr
|
||||
@ cdecl wcstod(wstr ptr) MSVCRT_wcstod
|
||||
@ stub wcstof
|
||||
@ cdecl wcstof(ptr ptr) MSVCRT_wcstof
|
||||
@ stub wcstoimax
|
||||
@ cdecl wcstok(wstr wstr) MSVCRT_wcstok
|
||||
@ cdecl wcstok_s(ptr wstr ptr) MSVCRT_wcstok_s
|
||||
|
|
|
@ -87,6 +87,7 @@ static void* (CDECL *p__W_Gettnames)(void);
|
|||
static void (CDECL *p_free)(void*);
|
||||
static float (CDECL *p_strtof)(const char *, char **);
|
||||
static int (CDECL *p__finite)(double);
|
||||
static float (CDECL *p_wcstof)(const wchar_t*, wchar_t**);
|
||||
|
||||
static BOOL init(void)
|
||||
{
|
||||
|
@ -111,6 +112,7 @@ static BOOL init(void)
|
|||
p_free = (void*)GetProcAddress(module, "free");
|
||||
p_strtof = (void*)GetProcAddress(module, "strtof");
|
||||
p__finite = (void*)GetProcAddress(module, "_finite");
|
||||
p_wcstof = (void*)GetProcAddress(module, "wcstof");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -334,6 +336,9 @@ static void test__strtof(void)
|
|||
const char float3[] = "-3.402823466e+38";
|
||||
const char float4[] = "1.7976931348623158e+308"; /* DBL_MAX */
|
||||
|
||||
const WCHAR twelve[] = {'1','2','.','0',0};
|
||||
const WCHAR arabic23[] = { 0x662, 0x663, 0};
|
||||
|
||||
char *end;
|
||||
float f;
|
||||
|
||||
|
@ -367,11 +372,31 @@ static void test__strtof(void)
|
|||
|
||||
f = p_strtof("0x12", NULL);
|
||||
ok(f == 0, "f = %lf\n", f);
|
||||
|
||||
f = p_wcstof(twelve, NULL);
|
||||
ok(f == 12.0, "f = %lf\n", f);
|
||||
|
||||
f = p_wcstof(arabic23, NULL);
|
||||
ok(f == 0, "f = %lf\n", f);
|
||||
|
||||
if(!p_setlocale(LC_ALL, "Arabic")) {
|
||||
win_skip("Arabic locale not available\n");
|
||||
return;
|
||||
}
|
||||
|
||||
f = p_wcstof(twelve, NULL);
|
||||
ok(f == 12.0, "f = %lf\n", f);
|
||||
|
||||
f = p_wcstof(arabic23, NULL);
|
||||
ok(f == 0, "f = %lf\n", f);
|
||||
|
||||
p_setlocale(LC_ALL, "C");
|
||||
}
|
||||
|
||||
START_TEST(msvcr120)
|
||||
{
|
||||
if (!init()) return;
|
||||
test__strtof();
|
||||
test_lconv();
|
||||
test__dsign();
|
||||
test__dpcomp();
|
||||
|
|
|
@ -1581,7 +1581,7 @@
|
|||
@ cdecl _wcsset(wstr long) msvcr120._wcsset
|
||||
@ cdecl _wcsset_s(wstr long long) msvcr120._wcsset_s
|
||||
@ cdecl _wcstod_l(wstr ptr) msvcr120._wcstod_l
|
||||
@ stub _wcstof_l
|
||||
@ cdecl _wcstof_l(wstr ptr ptr) msvcr120._wcstof_l
|
||||
@ cdecl -ret64 _wcstoi64(wstr ptr long) msvcr120._wcstoi64
|
||||
@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) msvcr120._wcstoi64_l
|
||||
@ stub _wcstoimax_l
|
||||
|
@ -2132,7 +2132,7 @@
|
|||
@ cdecl wcsspn(wstr wstr) msvcr120.wcsspn
|
||||
@ cdecl wcsstr(wstr wstr) msvcr120.wcsstr
|
||||
@ cdecl wcstod(wstr ptr) msvcr120.wcstod
|
||||
@ stub wcstof
|
||||
@ cdecl wcstof(ptr ptr) msvcr120.wcstof
|
||||
@ stub wcstoimax
|
||||
@ cdecl wcstok(wstr wstr) msvcr120.wcstok
|
||||
@ cdecl wcstok_s(ptr wstr ptr) msvcr120.wcstok_s
|
||||
|
|
|
@ -646,6 +646,22 @@ double CDECL MSVCRT__wtof_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale)
|
|||
return MSVCRT__wcstod_l(str, NULL, locale);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _wcstof_l (MSVCR120.@)
|
||||
*/
|
||||
float CDECL MSVCRT__wcstof_l( const MSVCRT_wchar_t *str, MSVCRT_wchar_t **end, MSVCRT__locale_t locale )
|
||||
{
|
||||
return MSVCRT__wcstod_l(str, end, locale);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* wcstof (MSVCR120.@)
|
||||
*/
|
||||
float CDECL MSVCRT_wcstof( const MSVCRT_wchar_t *str, MSVCRT_wchar_t **end )
|
||||
{
|
||||
return MSVCRT__wcstof_l(str, end, NULL);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* arg_clbk_valist (INTERNAL)
|
||||
*/
|
||||
|
|
|
@ -2037,7 +2037,7 @@
|
|||
@ cdecl _wcsset(wstr long) MSVCRT__wcsset
|
||||
@ cdecl _wcsset_s(wstr long long) MSVCRT__wcsset_s
|
||||
@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
|
||||
@ stub _wcstof_l
|
||||
@ cdecl _wcstof_l(wstr ptr ptr) MSVCRT__wcstof_l
|
||||
@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64
|
||||
@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l
|
||||
@ stub _wcstoimax_l
|
||||
|
@ -2576,7 +2576,7 @@
|
|||
@ cdecl wcsspn(wstr wstr) ntdll.wcsspn
|
||||
@ cdecl wcsstr(wstr wstr) MSVCRT_wcsstr
|
||||
@ cdecl wcstod(wstr ptr) MSVCRT_wcstod
|
||||
@ stub wcstof
|
||||
@ cdecl wcstof(ptr ptr) MSVCRT_wcstof
|
||||
@ stub wcstoimax
|
||||
@ cdecl wcstok(wstr wstr) MSVCRT_wcstok
|
||||
@ cdecl wcstok_s(ptr wstr ptr) MSVCRT_wcstok_s
|
||||
|
|
Loading…
Reference in New Issue