diff --git a/dlls/api-ms-win-crt-convert-l1-1-0/api-ms-win-crt-convert-l1-1-0.spec b/dlls/api-ms-win-crt-convert-l1-1-0/api-ms-win-crt-convert-l1-1-0.spec index 8cbb1849ffe..a67828e6d22 100644 --- a/dlls/api-ms-win-crt-convert-l1-1-0/api-ms-win-crt-convert-l1-1-0.spec +++ b/dlls/api-ms-win-crt-convert-l1-1-0/api-ms-win-crt-convert-l1-1-0.spec @@ -9,7 +9,7 @@ @ cdecl _atoi_l(str ptr) ucrtbase._atoi_l @ cdecl _atol_l(str ptr) ucrtbase._atol_l @ cdecl _atoldbl(ptr str) ucrtbase._atoldbl -@ stub _atoldbl_l +@ cdecl _atoldbl_l(ptr str ptr) ucrtbase._atoldbl_l @ cdecl -ret64 _atoll_l(str ptr) ucrtbase._atoll_l @ cdecl _ecvt(double long ptr ptr) ucrtbase._ecvt @ cdecl _ecvt_s(str long double long ptr ptr) ucrtbase._ecvt_s diff --git a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec index af84ff943b5..f74cea4e14c 100644 --- a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec +++ b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec @@ -187,7 +187,7 @@ @ cdecl _o__atoi_l(str ptr) ucrtbase._o__atoi_l @ cdecl _o__atol_l(str ptr) ucrtbase._o__atol_l @ cdecl _o__atoldbl(ptr str) ucrtbase._o__atoldbl -@ stub _o__atoldbl_l +@ cdecl _o__atoldbl_l(ptr str ptr) ucrtbase._o__atoldbl_l @ cdecl -ret64 _o__atoll_l(str ptr) ucrtbase._o__atoll_l @ cdecl _o__beep(long long) ucrtbase._o__beep @ cdecl _o__beginthread(ptr long ptr) ucrtbase._o__beginthread diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 12699a71fa3..a396ee38a76 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -562,7 +562,7 @@ @ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast @ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid @ cdecl __STRINGTOLD(ptr ptr str long) -@ stub __STRINGTOLD_L +@ cdecl __STRINGTOLD_L(ptr ptr str long ptr) @ stub __TypeMatch @ cdecl ___lc_codepage_func() @ cdecl ___lc_collate_cp_func() @@ -701,7 +701,7 @@ @ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ cdecl _atol_l(str ptr) MSVCRT__atol_l @ cdecl _atoldbl(ptr str) MSVCRT__atoldbl -@ stub _atoldbl_l +@ cdecl _atoldbl_l(ptr str ptr) MSVCRT__atoldbl_l @ cdecl _beep(long long) MSVCRT__beep @ cdecl _beginthread(ptr long ptr) @ cdecl _beginthreadex(ptr long ptr ptr long ptr) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 785baaef610..b91a5df3ab4 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -889,7 +889,7 @@ @ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast @ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid @ cdecl __STRINGTOLD(ptr ptr str long) -@ stub __STRINGTOLD_L +@ cdecl __STRINGTOLD_L(ptr ptr str long ptr) @ stub __TypeMatch @ cdecl ___lc_codepage_func() @ cdecl ___lc_collate_cp_func() @@ -1049,7 +1049,7 @@ @ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ cdecl _atol_l(str ptr) MSVCRT__atol_l @ cdecl _atoldbl(ptr str) MSVCRT__atoldbl -@ stub _atoldbl_l +@ cdecl _atoldbl_l(ptr str ptr) MSVCRT__atoldbl_l @ cdecl _beep(long long) MSVCRT__beep @ cdecl _beginthread(ptr long ptr) @ cdecl _beginthreadex(ptr long ptr ptr long ptr) diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 83daf454b62..dd7d48a8629 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -874,7 +874,7 @@ @ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast @ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid @ cdecl __STRINGTOLD(ptr ptr str long) -@ stub __STRINGTOLD_L +@ cdecl __STRINGTOLD_L(ptr ptr str long ptr) @ stub __TypeMatch @ cdecl ___lc_codepage_func() @ cdecl ___lc_collate_cp_func() @@ -1039,7 +1039,7 @@ @ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ cdecl _atol_l(str ptr) MSVCRT__atol_l @ cdecl _atoldbl(ptr str) MSVCRT__atoldbl -@ stub _atoldbl_l +@ cdecl _atoldbl_l(ptr str ptr) MSVCRT__atoldbl_l @ cdecl -ret64 _atoll_l(str ptr) MSVCRT__atoll_l @ cdecl _beep(long long) MSVCRT__beep @ cdecl _beginthread(ptr long ptr) diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 100599e2b2d..b8ffbbc7581 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -868,7 +868,7 @@ @ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcr120.__RTDynamicCast @ cdecl __RTtypeid(ptr) msvcr120.__RTtypeid @ cdecl __STRINGTOLD(ptr ptr str long) msvcr120.__STRINGTOLD -@ stub __STRINGTOLD_L +@ cdecl __STRINGTOLD_L(ptr ptr str long ptr) msvcr120.__STRINGTOLD_L @ stub __TypeMatch @ cdecl ___lc_codepage_func() msvcr120.___lc_codepage_func @ cdecl ___lc_collate_cp_func() msvcr120.___lc_collate_cp_func @@ -1010,7 +1010,7 @@ @ cdecl _atoi_l(str ptr) msvcr120._atoi_l @ cdecl _atol_l(str ptr) msvcr120._atol_l @ cdecl _atoldbl(ptr str) msvcr120._atoldbl -@ stub _atoldbl_l +@ cdecl _atoldbl_l(ptr str ptr) msvcr120._atoldbl_l @ cdecl -ret64 _atoll_l(str ptr) msvcr120._atoll_l @ cdecl _byteswap_uint64(int64) msvcr120._byteswap_uint64 @ cdecl _byteswap_ulong(long) msvcr120._byteswap_ulong diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 4a5e0875c26..4050750123a 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -196,7 +196,7 @@ @ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast @ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid @ cdecl __STRINGTOLD(ptr ptr str long) -@ stub __STRINGTOLD_L +@ cdecl __STRINGTOLD_L(ptr ptr str long ptr) @ stub __TypeMatch @ cdecl ___lc_codepage_func() @ cdecl ___lc_collate_cp_func() @@ -365,7 +365,7 @@ @ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ cdecl _atol_l(str ptr) MSVCRT__atol_l @ cdecl _atoldbl(ptr str) MSVCRT__atoldbl -@ stub _atoldbl_l +@ cdecl _atoldbl_l(ptr str ptr) MSVCRT__atoldbl_l @ cdecl _beep(long long) MSVCRT__beep @ cdecl _beginthread(ptr long ptr) @ cdecl _beginthreadex(ptr long ptr ptr long ptr) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 5401cd2a9c4..5208d3e5f35 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -187,7 +187,7 @@ @ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast @ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid @ cdecl __STRINGTOLD(ptr ptr str long) -@ stub __STRINGTOLD_L +@ cdecl __STRINGTOLD_L(ptr ptr str long ptr) @ stub __TypeMatch @ cdecl ___lc_codepage_func() @ cdecl ___lc_collate_cp_func() @@ -349,7 +349,7 @@ @ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ cdecl _atol_l(str ptr) MSVCRT__atol_l @ cdecl _atoldbl(ptr str) MSVCRT__atoldbl -@ stub _atoldbl_l +@ cdecl _atoldbl_l(ptr str ptr) MSVCRT__atoldbl_l @ cdecl _beep(long long) MSVCRT__beep @ cdecl _beginthread(ptr long ptr) @ cdecl _beginthreadex(ptr long ptr ptr long ptr) diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 36284cf14aa..2dc9c87e57a 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -336,7 +336,7 @@ @ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ cdecl _atol_l(str ptr) MSVCRT__atol_l @ cdecl _atoldbl(ptr str) MSVCRT__atoldbl -# stub _atoldbl_l(ptr str ptr) +@ cdecl _atoldbl_l(ptr str ptr) MSVCRT__atoldbl_l @ cdecl _beep(long long) MSVCRT__beep @ cdecl _beginthread (ptr long ptr) @ cdecl _beginthreadex (ptr long ptr ptr long ptr) diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 30b2525692b..806dace0409 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -1233,30 +1233,14 @@ MSVCRT_size_t CDECL MSVCRT_strxfrm( char *dest, const char *src, MSVCRT_size_t l } /******************************************************************** - * _atoldbl (MSVCRT.@) + * __STRINGTOLD_L (MSVCR80.@) */ -int CDECL MSVCRT__atoldbl(MSVCRT__LDOUBLE *value, const char *str) -{ - /* FIXME needs error checking for huge/small values */ -#ifdef HAVE_STRTOLD - long double ld; - TRACE("str %s value %p\n",str,value); - ld = strtold(str,0); - memcpy(value, &ld, 10); -#else - FIXME("stub, str %s value %p\n",str,value); -#endif - return 0; -} - -/******************************************************************** - * __STRINGTOLD (MSVCRT.@) - */ -int CDECL __STRINGTOLD( MSVCRT__LDOUBLE *value, char **endptr, const char *str, int flags ) +int CDECL __STRINGTOLD_L( MSVCRT__LDOUBLE *value, char **endptr, + const char *str, int flags, MSVCRT__locale_t locale ) { #ifdef HAVE_STRTOLD long double ld; - FIXME("%p %p %s %x partial stub\n", value, endptr, str, flags ); + FIXME("%p %p %s %x %p partial stub\n", value, endptr, str, flags, locale ); ld = strtold(str,0); memcpy(value, &ld, 10); #else @@ -1265,6 +1249,36 @@ int CDECL __STRINGTOLD( MSVCRT__LDOUBLE *value, char **endptr, const char *str, return 0; } +/******************************************************************** + * __STRINGTOLD (MSVCRT.@) + */ +int CDECL __STRINGTOLD( MSVCRT__LDOUBLE *value, char **endptr, const char *str, int flags ) +{ + return __STRINGTOLD_L( value, endptr, str, flags, NULL ); +} + +/******************************************************************** + * _atoldbl_l (MSVCRT.@) + */ +int CDECL MSVCRT__atoldbl_l( MSVCRT__LDOUBLE *value, const char *str, MSVCRT__locale_t locale ) +{ + char *endptr; + switch(__STRINGTOLD_L( value, &endptr, str, 0, locale )) + { + case 1: return MSVCRT__UNDERFLOW; + case 2: return MSVCRT__OVERFLOW; + default: return 0; + } +} + +/******************************************************************** + * _atoldbl (MSVCRT.@) + */ +int CDECL MSVCRT__atoldbl(MSVCRT__LDOUBLE *value, const char *str) +{ + return MSVCRT__atoldbl_l( value, str, NULL ); +} + /********************************************************************* * strlen (MSVCRT.@) */ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 6dc73d47fd5..689b3d7c951 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -200,7 +200,7 @@ @ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ cdecl _atol_l(str ptr) MSVCRT__atol_l @ cdecl _atoldbl(ptr str) MSVCRT__atoldbl -@ stub _atoldbl_l +@ cdecl _atoldbl_l(ptr str ptr) MSVCRT__atoldbl_l @ cdecl -ret64 _atoll_l(str ptr) MSVCRT__atoll_l @ cdecl _beep(long long) MSVCRT__beep @ cdecl _beginthread(ptr long ptr) @@ -851,7 +851,7 @@ @ cdecl _o__atoi_l(str ptr) MSVCRT__atoi_l @ cdecl _o__atol_l(str ptr) MSVCRT__atol_l @ cdecl _o__atoldbl(ptr str) MSVCRT__atoldbl -@ stub _o__atoldbl_l +@ cdecl _o__atoldbl_l(ptr str ptr) MSVCRT__atoldbl_l @ cdecl -ret64 _o__atoll_l(str ptr) MSVCRT__atoll_l @ cdecl _o__beep(long long) MSVCRT__beep @ cdecl _o__beginthread(ptr long ptr) _beginthread